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 { NavLink } from "react-router-dom"; | ||||||
| import "../assets/stylesheets/browse.scss"; | import "../assets/stylesheets/browse.scss"; | ||||||
|  |  | ||||||
|  | const hostname = window.location.hostname;  // Get the hostname from the URL bar | ||||||
|  |  | ||||||
| export default class cable { | export default class cable { | ||||||
|   constructor( |   constructor( | ||||||
|     part_number, |     part_number, | ||||||
| @@ -19,7 +21,7 @@ export default class cable { | |||||||
|     this.position = position; |     this.position = position; | ||||||
|     this.name = name; |     this.name = name; | ||||||
|     this.brand = brand; |     this.brand = brand; | ||||||
|     this.image = image ? `http://localhost${image}` : DefaultPartImg; |     this.image = image ? `http://${hostname}${image}` : DefaultPartImg; | ||||||
|  |  | ||||||
|     this.category = category; |     this.category = category; | ||||||
|     this.application = application; |     this.application = application; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user