read comment notification working
This commit is contained in:
parent
9222069ef5
commit
246d21f85a
17 changed files with 86 additions and 111 deletions
|
|
@ -109,7 +109,7 @@ const getStatus = computed(() => {
|
|||
const correspondingNotification = userStore.notifications.find(
|
||||
(notification) => notification.id === comment.id
|
||||
);
|
||||
if (correspondingNotification && correspondingNotification.isread != "true") {
|
||||
if (correspondingNotification && !correspondingNotification.isRead) {
|
||||
return "unread";
|
||||
}
|
||||
return undefined;
|
||||
|
|
@ -143,7 +143,7 @@ function handleClick() {
|
|||
async function read() {
|
||||
if (getStatus.value !== "unread") return;
|
||||
try {
|
||||
const newNotification = await api.readNotification(comment.id);
|
||||
const newNotification = await api.readNotification(comment);
|
||||
console.log(newNotification);
|
||||
userStore.readNotification(comment.id);
|
||||
} catch (error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue