X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FApi%2FMastodon%2FNotifications%2FDismiss.php;h=9771f1df6fd0aefbffee77f79eeecad8f2a9b7e6;hb=1b9ec3a2147fc10e4037ff1b2a7aac506cdf3b13;hp=a0f57a40589cc029d13852bddf5aefb49cb8c162;hpb=1c4cc151524ca612316020605cb98faf63988bfd;p=friendica.git diff --git a/src/Module/Api/Mastodon/Notifications/Dismiss.php b/src/Module/Api/Mastodon/Notifications/Dismiss.php index a0f57a4058..9771f1df6f 100644 --- a/src/Module/Api/Mastodon/Notifications/Dismiss.php +++ b/src/Module/Api/Mastodon/Notifications/Dismiss.php @@ -1,6 +1,6 @@ checkAllowedScope(self::SCOPE_WRITE); $uid = self::getCurrentUserID(); - if (empty($parameters['id'])) { - DI::mstdnError()->UnprocessableEntity(); + if (empty($this->parameters['id'])) { + $this->logAndJsonError(422, $this->errorFactory->UnprocessableEntity()); } - DBA::update('notify', ['seen' => true], ['uid' => $uid, 'id' => $parameters['id']]); + $condition = ['id' => $this->parameters['id']]; + $Notification = DI::notification()->selectOneForUser($uid, $condition); + $Notification->setDismissed(); + DI::notification()->save($Notification); - System::jsonExit([]); + $this->jsonExit([]); } }