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

@ -21,9 +21,9 @@
namespace Friendica\Module\Api\Friendica\Photo;
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;
@ -64,7 +64,7 @@ class Delete extends BaseApi
Item::deleteForUser($condition, $uid);
$result = ['result' => 'deleted', 'message' => 'photo with id `' . $request['photo_id'] . '` has been deleted from server.'];
ApiResponse::exit('photo_delete', ['$result' => $result], $parameters['extension'] ?? null);
DI::apiResponse()->exit('photo_delete', ['$result' => $result], $parameters['extension'] ?? null);
} else {
throw new InternalServerErrorException("unknown error on deleting photo from database table");
}