Skip to content

Commit

Permalink
fix: change controller to handle nested data attributes (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideIadeluca authored Jul 30, 2024
1 parent ac81ad2 commit 58839bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Api/Controllers/UpdateHeaderItemController.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ protected function data(ServerRequestInterface $request, Document $document)
$id = Arr::get($request->getQueryParams(), 'id');
$data = $request->getParsedBody();

if (Arr::has($data, 'attributes.header')) {
Arr::set($data, 'attributes.header', Header::decode(Arr::get($data, 'attributes.header')));
if (Arr::has($data, 'data.attributes.header')) {
Arr::set($data, 'data.attributes.header', Header::decode(Arr::get($data, 'data.attributes.header')));
}

$this->validator->assertValid($data);
Expand Down

0 comments on commit 58839bb

Please sign in to comment.