]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Api/Mastodon/Notifications/Dismiss.php
Rename BaseApi->logErrorAndJsonExit to logAndJsonError to better match the functionality
[friendica.git] / src / Module / Api / Mastodon / Notifications / Dismiss.php
index 5fc4e95b94827783eae1db482d4f1c5903daaa4d..9771f1df6fd0aefbffee77f79eeecad8f2a9b7e6 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -34,11 +34,11 @@ class Dismiss extends BaseApi
 {
        protected function post(array $request = [])
        {
-               self::checkAllowedScope(self::SCOPE_WRITE);
+               $this->checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
 
                if (empty($this->parameters['id'])) {
-                       DI::mstdnError()->UnprocessableEntity();
+                       $this->logAndJsonError(422, $this->errorFactory->UnprocessableEntity());
                }
 
                $condition = ['id' => $this->parameters['id']];
@@ -46,6 +46,6 @@ class Dismiss extends BaseApi
                $Notification->setDismissed();
                DI::notification()->save($Notification);
 
-               System::jsonExit([]);
+               $this->jsonExit([]);
        }
 }