Fix browse page image URL

This commit is contained in:
Cole Deck 2024-05-14 17:37:06 -05:00
parent 3781e9adcf
commit 359778be51

View File

@ -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;