X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FApi%2FMastodon%2FNotifications%2FDismiss.php;h=9771f1df6fd0aefbffee77f79eeecad8f2a9b7e6;hb=1b9ec3a2147fc10e4037ff1b2a7aac506cdf3b13;hp=e8faa3096eb381b23a40d09e60dfd4c7f10451ce;hpb=b34ee320b0ce356d73f98af92231aab5d1cbdf6b;p=friendica.git diff --git a/src/Module/Api/Mastodon/Notifications/Dismiss.php b/src/Module/Api/Mastodon/Notifications/Dismiss.php index e8faa3096e..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([]); } }