read read notification in front end working

This commit is contained in:
isUnknown 2024-11-17 12:23:28 +01:00
parent fe56312f20
commit 583daa1759
6 changed files with 35 additions and 57 deletions

View file

@ -27,30 +27,8 @@ Comments:
role: admin
position:
pageIndex: 1
x: "34.157449699143"
y: "50.965250965251"
date: 2024-11-17T11:51:35+01:00
id: m3lh8h5h
type: comment
isRead: false
-
page:
uri: projects/miss-dior-blooming-bouquet
title: Miss Dior Blooming Bouquet
file:
uuid: file://s0lNtRA0Z7ybTCWG
replies: [ ]
text: deuxième commentaire
author:
name: Adrien Payet
email: adrien.payet@outlook.com
uuid: user://WWjXgPWk
role: admin
position:
pageIndex: 1
x: '84.696990994209'
y: '56.949806949807'
date: 2024-11-17T11:59:37+01:00
id: m3lhisy6
type: comment
isRead: false
x: '25.96184356358'
y: '22.393822393822'
date: 2024-11-17T12:13:39+01:00
id: m3li0uhb
type: comment

View file

@ -43,7 +43,6 @@ class BaseComment {
$this->date = $date;
$this->id = $id;
$this->type = $type;
$this->isRead = false;
$this->position = $position;
}
@ -79,20 +78,6 @@ class BaseComment {
return $this->type;
}
public function isRead() {
return $this->isRead;
}
public function read() {
$this->isRead = true;
return $this->isRead;
}
public function unread() {
$this->isRead = false;
return $this->isRead;
}
public function pageIndex() {
$this->position['pageIndex'];
}
@ -108,7 +93,6 @@ class BaseComment {
'date' => $this->date,
'id' => $this->id,
'type' => $this->type,
'isRead' => $this->isRead
];
}
}

View file

@ -15,7 +15,6 @@ return function($project, $notificationId) {
}
}
// Réindexation et ré-encodage en YAML avant la mise à jour
$user->update([
'notifications' => Yaml::encode(array_values($notifications))
]);

View file

@ -14,6 +14,7 @@
*/
return function ($projectUri, $notificationData) {
$notificationData['isRead'] = false;
$recipients = page($projectUri)->managers()->toUsers()->not($this);
if (!$recipients) return;