]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Api/Friendica/Photoalbum/Update.php
Merge pull request #11005 from nupplaphil/feat/module_di
[friendica.git] / src / Module / Api / Friendica / Photoalbum / Update.php
index 75ea48a82db11f077b511748208666485c834650..87513c5ad4d7db5e890d6fe460d86aa6bf0d4b58 100644 (file)
@@ -21,8 +21,8 @@
 
 namespace Friendica\Module\Api\Friendica\Photoalbum;
 
+use Friendica\DI;
 use Friendica\Model\Photo;
-use Friendica\Module\Api\ApiResponse;
 use Friendica\Module\BaseApi;
 use Friendica\Network\HTTPException\BadRequestException;
 use Friendica\Network\HTTPException\InternalServerErrorException;
@@ -32,7 +32,7 @@ use Friendica\Network\HTTPException\InternalServerErrorException;
  */
 class Update extends BaseApi
 {
-       public static function rawContent(array $parameters = [])
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
@@ -43,10 +43,10 @@ class Update extends BaseApi
                ]);
 
                // we do not allow calls without album string
-               if ($request['album'] == "") {
+               if (empty($request['album'])) {
                        throw new BadRequestException("no albumname specified");
                }
-               if ($request['album_new'] == "") {
+               if (empty($request['album_new'])) {
                        throw new BadRequestException("no new albumname specified");
                }
                // check if album is existing
@@ -59,7 +59,7 @@ class Update extends BaseApi
                // return success of updating or error message
                if ($result) {
                        $answer = ['result' => 'updated', 'message' => 'album `' . $request['album'] . '` with all containing photos has been renamed to `' . $request['album_new'] . '`.'];
-                       ApiResponse::exit('photoalbum_update', ['$result' => $answer], $parameters['extension'] ?? null);
+                       $this->response->exit('photoalbum_update', ['$result' => $answer], $this->parameters['extension'] ?? null);
                } else {
                        throw new InternalServerErrorException("unknown error - updating in database failed");
                }