alert mark as read bug fix

This commit is contained in:
2025-06-24 11:43:08 +05:30
parent ad24708f85
commit 985f121a90

View File

@@ -85,11 +85,12 @@ export async function markAsRead(alertId: string, user: AuthenticatedUser) {
if (!updatedAlert) return null; if (!updatedAlert) return null;
updatedAlert["read"] = updatedAlert.readBy.includes(user.userId) const modifiedAlert = {
? true ...updatedAlert.toObject(),
: false; read: updatedAlert.readBy.includes(user.userId) ? true : false,
};
return updatedAlert; return modifiedAlert;
} }
export async function getUnreadCount(user: AuthenticatedUser) { export async function getUnreadCount(user: AuthenticatedUser) {