alert mark as read bug fix
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user