fix(souq): add missing /mobile basePath prefix to listing API fetch
fetch('/api/marketplace/listings?...') was hitting the wrong URL
(404) because the app is deployed under /mobile basePath. Changed
to fetch('/mobile/api/marketplace/listings?...') which matches the
correct API route.
This commit is contained in:
@@ -97,7 +97,7 @@ export default function SouqPage() {
|
|||||||
if (activeCategory !== "All") params.set("category", activeCategory);
|
if (activeCategory !== "All") params.set("category", activeCategory);
|
||||||
if (searchQuery.trim()) params.set("search", searchQuery.trim());
|
if (searchQuery.trim()) params.set("search", searchQuery.trim());
|
||||||
|
|
||||||
const res = await fetch(`/api/marketplace/listings?${params.toString()}`);
|
const res = await fetch(`/mobile/api/marketplace/listings?${params.toString()}`);
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
setListings(data.listings);
|
setListings(data.listings);
|
||||||
|
|||||||
Reference in New Issue
Block a user