Fix browse page image URL
This commit is contained in:
		| @@ -3,6 +3,8 @@ import DefaultPartImg from "../assets/images/part.png"; | ||||
| import { NavLink } from "react-router-dom"; | ||||
| import "../assets/stylesheets/browse.scss"; | ||||
|  | ||||
| const hostname = window.location.hostname;  // Get the hostname from the URL bar | ||||
|  | ||||
| export default class cable { | ||||
|   constructor( | ||||
|     part_number, | ||||
| @@ -19,7 +21,7 @@ export default class cable { | ||||
|     this.position = position; | ||||
|     this.name = name; | ||||
|     this.brand = brand; | ||||
|     this.image = image ? `http://localhost${image}` : DefaultPartImg; | ||||
|     this.image = image ? `http://${hostname}${image}` : DefaultPartImg; | ||||
|  | ||||
|     this.category = category; | ||||
|     this.application = application; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user