]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Api/Mastodon/Statuses/Unmute.php
Move jsonError out of Factory\Api\Mastodon\Error->UnprocessableEntity
[friendica.git] / src / Module / Api / Mastodon / Statuses / Unmute.php
index 511ae15407a29e208b9d097b30c21703638fda5c..e54380dbe59754a2f51967daa907534b72c688fd 100644 (file)
@@ -39,7 +39,7 @@ class Unmute extends BaseApi
                $uid = self::getCurrentUserID();
 
                if (empty($this->parameters['id'])) {
-                       DI::mstdnError()->UnprocessableEntity();
+                       $this->logErrorAndJsonExit(422, $this->errorFactory->UnprocessableEntity());
                }
 
                $item = Post::selectOriginalForUser($uid, ['uri-id', 'gravity'], ['uri-id' => $this->parameters['id'], 'uid' => [$uid, 0]]);
@@ -48,7 +48,7 @@ class Unmute extends BaseApi
                }
 
                if ($item['gravity'] != Item::GRAVITY_PARENT) {
-                       DI::mstdnError()->UnprocessableEntity(DI::l10n()->t('Only starting posts can be unmuted'));
+                       $this->logErrorAndJsonExit(422, $this->errorFactory->UnprocessableEntity($this->t('Only starting posts can be unmuted')));
                }
 
                Post\ThreadUser::setIgnored($item['uri-id'], $uid, false);