API: Set "dismissed" instead of "seen"

This commit is contained in:
Michael 2021-12-28 20:38:18 +00:00
parent c371d2ec82
commit f7e859ec2c
10 changed files with 36 additions and 13 deletions

View file

@ -110,6 +110,13 @@ class Notification extends BaseRepository
return $this->db->update(self::$table_name, ['seen' => true], $condition);
}
public function setAllDismissedForUser(int $uid, array $condition = []): bool
{
$condition = DBA::mergeConditions($condition, ['uid' => $uid]);
return $this->db->update(self::$table_name, ['dismissed' => true], $condition);
}
/**
* @param Entity\Notification $Notification
* @return Entity\Notification
@ -125,6 +132,7 @@ class Notification extends BaseRepository
'target-uri-id' => $Notification->targetUriId,
'parent-uri-id' => $Notification->parentUriId,
'seen' => $Notification->seen,
'dismissed' => $Notification->dismissed,
];
if ($Notification->id) {