whoop
This commit is contained in:
@@ -42,8 +42,10 @@ export default function ChatNotifications() {
|
||||
}
|
||||
});
|
||||
|
||||
// Get vendor ID (placeholder until proper JWT decoding)
|
||||
const vendorId = "current"; // Replace with actual ID extraction
|
||||
// Get vendor ID from profile
|
||||
const vendorResponse = await authAxios.get('/auth/me');
|
||||
|
||||
const vendorId = vendorResponse.data.vendor._id;
|
||||
|
||||
const response = await authAxios.get(`/chats/vendor/${vendorId}/unread`);
|
||||
setUnreadCounts(response.data);
|
||||
@@ -60,7 +62,7 @@ export default function ChatNotifications() {
|
||||
await Promise.all(
|
||||
chatIds.map(async (chatId) => {
|
||||
try {
|
||||
const chatResponse = await authAxios.get(`/chats/${chatId}`);
|
||||
const chatResponse = await authAxios.get(`/api/chats/${chatId}`);
|
||||
metadata[chatId] = {
|
||||
buyerId: chatResponse.data.buyerId,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user