diff --git a/components/dashboard/NewChatForm.tsx b/components/dashboard/NewChatForm.tsx index 42aec8f..eb5f019 100644 --- a/components/dashboard/NewChatForm.tsx +++ b/components/dashboard/NewChatForm.tsx @@ -136,8 +136,11 @@ export default function NewChatForm() { } try { - // Get vendor profile first - const vendorResponse = await authAxios.get("/auth/me"); + // Fetch vendor profile and store in parallel + const [vendorResponse, storeResponse] = await Promise.all([ + authAxios.get("/auth/me"), + authAxios.get("/storefront"), + ]); // Extract vendor ID properly const vendorId = vendorResponse.data.vendor?._id; @@ -151,9 +154,6 @@ export default function NewChatForm() { return; } - // Fetch store - const storeResponse = await authAxios.get(`/storefront`); - // Handle both array and single object responses if (Array.isArray(storeResponse.data)) { setVendorStores(storeResponse.data);