read comment working

This commit is contained in:
isUnknown 2024-11-18 09:36:15 +01:00
parent 583daa1759
commit 39fc379541
12 changed files with 125 additions and 78 deletions

View file

@ -10,5 +10,13 @@ export const useUserStore = defineStore("user", () => {
: Object.values(user.value.notifications);
});
return { user, notifications };
function readNotification(notificationId) {
user.value.notifications.forEach((notification) => {
if (notification.id === notificationId) {
notification.isRead = true;
}
});
}
return { user, notifications, readNotification };
});