namespace Friendica\Module\Api\Friendica\Photoalbum;
+use Friendica\DI;
use Friendica\Model\Photo;
use Friendica\Module\BaseApi;
use Friendica\Network\HTTPException\BadRequestException;
*/
class Update extends BaseApi
{
- public static function rawContent(array $parameters = [])
+ protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
]);
// 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
// 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'] . '`.'];
- self::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");
}