mirror of
https://github.com/Karaka-Management/oms-Media.git
synced 2026-02-13 15:58:42 +00:00
add tests
This commit is contained in:
parent
2e5ec71f29
commit
d6d7bc2f89
|
|
@ -291,7 +291,7 @@ final class ApiController extends Controller
|
||||||
{
|
{
|
||||||
$old = clone MediaMapper::get((int) $request->getData('id'));
|
$old = clone MediaMapper::get((int) $request->getData('id'));
|
||||||
$new = $this->updateMediaFromRequest($request);
|
$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);
|
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Media', 'Media successfully updated', $new);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -532,13 +532,16 @@ class Media implements \JsonSerializable
|
||||||
public function toArray() : array
|
public function toArray() : array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'id' => $this->id,
|
'id' => $this->id,
|
||||||
'name' => $this->name,
|
'name' => $this->name,
|
||||||
'description' => $this->description,
|
'description' => $this->description,
|
||||||
'extension' => $this->extension,
|
'descriptionRaw' => $this->descriptionRaw,
|
||||||
'virtualpath' => $this->virtualPath,
|
'extension' => $this->extension,
|
||||||
'size' => $this->size,
|
'virtualpath' => $this->virtualPath,
|
||||||
'hidden' => $this->hidden,
|
'size' => $this->size,
|
||||||
|
'hidden' => $this->hidden,
|
||||||
|
'path' => $this->path,
|
||||||
|
'absolute' => $this->isAbsolute,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user