diff --git a/Controller/ApiController.php b/Controller/ApiController.php index f3fc8c6..2da1891 100644 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -291,7 +291,7 @@ final class ApiController extends Controller { $old = clone MediaMapper::get((int) $request->getData('id')); $new = $this->updateMediaFromRequest($request); - $this->updateModel($request, $old, $new, MediaMapper::class, 'media'); + $this->updateModel($request->getHeader()->getAccount(), $old, $new, MediaMapper::class, 'media'); $this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Media', 'Media successfully updated', $new); } diff --git a/Models/Media.php b/Models/Media.php index a00750b..f93e5da 100644 --- a/Models/Media.php +++ b/Models/Media.php @@ -532,13 +532,16 @@ class Media implements \JsonSerializable public function toArray() : array { return [ - 'id' => $this->id, - 'name' => $this->name, - 'description' => $this->description, - 'extension' => $this->extension, - 'virtualpath' => $this->virtualPath, - 'size' => $this->size, - 'hidden' => $this->hidden, + 'id' => $this->id, + 'name' => $this->name, + 'description' => $this->description, + 'descriptionRaw' => $this->descriptionRaw, + 'extension' => $this->extension, + 'virtualpath' => $this->virtualPath, + 'size' => $this->size, + 'hidden' => $this->hidden, + 'path' => $this->path, + 'absolute' => $this->isAbsolute, ]; }