hmmmammamam
This commit is contained in:
@@ -90,9 +90,6 @@ export default function BroadcastDialog({ open, setOpen }: BroadcastDialogProps)
|
||||
try {
|
||||
setIsSending(true);
|
||||
|
||||
const API_URL = process.env.NEXT_PUBLIC_API_URL;
|
||||
if (!API_URL) throw new Error("API URL not configured");
|
||||
|
||||
// Get auth token from cookie
|
||||
const authToken = document.cookie
|
||||
.split("; ")
|
||||
|
||||
@@ -51,7 +51,7 @@ export const ProductModal: React.FC<ProductModalProps> = ({
|
||||
// If productData.image is a *URL* (string), show it as a default preview
|
||||
useEffect(() => {
|
||||
if (productData.image && typeof productData.image === "string" && productData._id) {
|
||||
setImagePreview(`${process.env.NEXT_PUBLIC_API_URL}/products/${productData._id}/image`);
|
||||
setImagePreview(`/api/products/${productData._id}/image`);
|
||||
} else if (productData.image && typeof productData.image === "string") {
|
||||
// Image exists but no ID, this is probably a new product
|
||||
setImagePreview(null);
|
||||
|
||||
Reference in New Issue
Block a user