Move API Response methods into an own class to make them mockable
This commit is contained in:
parent
893b8e5df3
commit
319f91301d
22 changed files with 327 additions and 259 deletions
|
|
@ -24,6 +24,7 @@ namespace Friendica\Module\Api\Friendica\Photoalbum;
|
|||
use Friendica\Database\DBA;
|
||||
use Friendica\Model\Item;
|
||||
use Friendica\Model\Photo;
|
||||
use Friendica\Module\Api\ApiResponse;
|
||||
use Friendica\Module\BaseApi;
|
||||
use Friendica\Network\HTTPException\BadRequestException;
|
||||
use Friendica\Network\HTTPException\InternalServerErrorException;
|
||||
|
|
@ -66,7 +67,7 @@ class Delete extends BaseApi
|
|||
// return success of deletion or error message
|
||||
if ($result) {
|
||||
$answer = ['result' => 'deleted', 'message' => 'album `' . $request['album'] . '` with all containing photos has been deleted.'];
|
||||
self::exit('photoalbum_delete', ['$result' => $answer], $parameters['extension'] ?? null);
|
||||
ApiResponse::exit('photoalbum_delete', ['$result' => $answer], $parameters['extension'] ?? null);
|
||||
} else {
|
||||
throw new InternalServerErrorException("unknown error - deleting from database failed");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue