mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-12 01:54:26 +02:00
Move jsonError out of Factory\Api\Mastodon\Error->UnprocessableEntity
This commit is contained in:
parent
7f846f153d
commit
7486ebdc10
52 changed files with 76 additions and 73 deletions
|
@ -39,7 +39,7 @@ class Bookmark extends BaseApi
|
|||
$uid = self::getCurrentUserID();
|
||||
|
||||
if (empty($this->parameters['id'])) {
|
||||
DI::mstdnError()->UnprocessableEntity();
|
||||
$this->logErrorAndJsonExit(422, $this->errorFactory->UnprocessableEntity());
|
||||
}
|
||||
|
||||
$item = Post::selectOriginal(['uid', 'id', 'uri-id', 'gravity'], ['uri-id' => $this->parameters['id'], 'uid' => [$uid, 0]], ['order' => ['uid' => true]]);
|
||||
|
@ -48,7 +48,7 @@ class Bookmark extends BaseApi
|
|||
}
|
||||
|
||||
if ($item['gravity'] != Item::GRAVITY_PARENT) {
|
||||
DI::mstdnError()->UnprocessableEntity(DI::l10n()->t('Only starting posts can be bookmarked'));
|
||||
$this->logErrorAndJsonExit(422, $this->errorFactory->UnprocessableEntity($this->t('Only starting posts can be bookmarked')));
|
||||
}
|
||||
|
||||
if ($item['uid'] == 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue