This commit is contained in:
NotII
2025-03-23 23:53:45 +00:00
parent edc220bc5d
commit 3413e3b1e8
8 changed files with 122 additions and 88 deletions

View File

@@ -91,7 +91,8 @@ export const updateProductStock = async (
authToken: string
) => {
try {
const url = `${process.env.NEXT_PUBLIC_API_URL}/stock/${productId}`;
// Use Next.js API proxy to ensure request goes through rewrites
const url = `/api/stock/${productId}`;
return await fetchData(url, {
method: "PUT",
headers: {