1
0
Fork 0

Transform ApiResponse::exit() into dynamic method

This commit is contained in:
Philipp Holzer 2021-11-12 20:03:27 +01:00
commit ea0f41ecf0
Signed by: nupplaPhil
GPG key ID: 24A7501396EB5432
13 changed files with 27 additions and 30 deletions

View file

@ -22,9 +22,9 @@
namespace Friendica\Module\Api\Friendica\Photoalbum;
use Friendica\Database\DBA;
use Friendica\DI;
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;
@ -67,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.'];
ApiResponse::exit('photoalbum_delete', ['$result' => $answer], $parameters['extension'] ?? null);
DI::apiResponse()->exit('photoalbum_delete', ['$result' => $answer], $parameters['extension'] ?? null);
} else {
throw new InternalServerErrorException("unknown error - deleting from database failed");
}