From 12415d542607eaebcc94a14dcebdbcee80d0a879 Mon Sep 17 00:00:00 2001 From: fahed Date: Sun, 1 Mar 2026 11:19:54 +0300 Subject: [PATCH] fix: replace hardcoded localhost:3001 URLs with relative paths Fixes CORS errors when deployed behind a reverse proxy by removing hardcoded localhost references in Brands.jsx and PostCard.jsx. Co-Authored-By: Claude Opus 4.6 --- client/src/components/PostCard.jsx | 2 +- client/src/pages/Brands.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/components/PostCard.jsx b/client/src/components/PostCard.jsx index 792dd32..b500b8f 100644 --- a/client/src/components/PostCard.jsx +++ b/client/src/components/PostCard.jsx @@ -27,7 +27,7 @@ export default function PostCard({ post, onClick, onMove, compact = false }) { > {post.thumbnail_url && (
- +
)} diff --git a/client/src/pages/Brands.jsx b/client/src/pages/Brands.jsx index b6a76ec..da37314 100644 --- a/client/src/pages/Brands.jsx +++ b/client/src/pages/Brands.jsx @@ -7,7 +7,7 @@ import { AppContext } from '../App' import Modal from '../components/Modal' import { SkeletonCard } from '../components/SkeletonLoader' -const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:3001/api' +const API_BASE = '/api' const EMPTY_BRAND = { name: '', name_ar: '', priority: 2, icon: '' }