]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Api/Mastodon/Tags/Unfollow.php
Move jsonError out of Factory\Api\Mastodon\Error->UnprocessableEntity
[friendica.git] / src / Module / Api / Mastodon / Tags / Unfollow.php
index 06b08b7c3d1130bb80a048a1977d312bfcae2263..07b93d95a2dedc8c2cf3a4feb752f5445f556235 100644 (file)
@@ -33,11 +33,11 @@ class Unfollow extends BaseApi
 {
        protected function post(array $request = [])
        {
-               self::checkAllowedScope(self::SCOPE_WRITE);
+               $this->checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
 
                if (empty($this->parameters['hashtag'])) {
-                       DI::mstdnError()->UnprocessableEntity();
+                       $this->logErrorAndJsonExit(422, $this->errorFactory->UnprocessableEntity());
                }
 
                $term = ['uid' => $uid, 'term' => '#' . ltrim($this->parameters['hashtag'], '#')];
@@ -45,6 +45,6 @@ class Unfollow extends BaseApi
                DBA::delete('search', $term);
 
                $hashtag = new \Friendica\Object\Api\Mastodon\Tag($this->baseUrl, ['name' => ltrim($this->parameters['hashtag'])], [], false);
-               System::jsonExit($hashtag->toArray());
+               $this->jsonExit($hashtag->toArray());
        }
 }