mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-12 01:54:26 +02:00
Rename BaseApi->logErrorAndJsonExit to logAndJsonError to better match the functionality
- Also it's shorter and we're paying by the character
This commit is contained in:
parent
eb583330df
commit
1b9ec3a214
57 changed files with 128 additions and 128 deletions
|
@ -39,16 +39,16 @@ class Bookmark extends BaseApi
|
|||
$uid = self::getCurrentUserID();
|
||||
|
||||
if (empty($this->parameters['id'])) {
|
||||
$this->logErrorAndJsonExit(422, $this->errorFactory->UnprocessableEntity());
|
||||
$this->logAndJsonError(422, $this->errorFactory->UnprocessableEntity());
|
||||
}
|
||||
|
||||
$item = Post::selectOriginal(['uid', 'id', 'uri-id', 'gravity'], ['uri-id' => $this->parameters['id'], 'uid' => [$uid, 0]], ['order' => ['uid' => true]]);
|
||||
if (!DBA::isResult($item)) {
|
||||
$this->logErrorAndJsonExit(404, $this->errorFactory->RecordNotFound());
|
||||
$this->logAndJsonError(404, $this->errorFactory->RecordNotFound());
|
||||
}
|
||||
|
||||
if ($item['gravity'] != Item::GRAVITY_PARENT) {
|
||||
$this->logErrorAndJsonExit(422, $this->errorFactory->UnprocessableEntity($this->t('Only starting posts can be bookmarked')));
|
||||
$this->logAndJsonError(422, $this->errorFactory->UnprocessableEntity($this->t('Only starting posts can be bookmarked')));
|
||||
}
|
||||
|
||||
if ($item['uid'] == 0) {
|
||||
|
@ -56,10 +56,10 @@ class Bookmark extends BaseApi
|
|||
if (!empty($stored)) {
|
||||
$item = Post::selectFirst(['id', 'gravity'], ['id' => $stored]);
|
||||
if (!DBA::isResult($item)) {
|
||||
$this->logErrorAndJsonExit(404, $this->errorFactory->RecordNotFound());
|
||||
$this->logAndJsonError(404, $this->errorFactory->RecordNotFound());
|
||||
}
|
||||
} else {
|
||||
$this->logErrorAndJsonExit(404, $this->errorFactory->RecordNotFound());
|
||||
$this->logAndJsonError(404, $this->errorFactory->RecordNotFound());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue