From 56b3df021b001a07f98093757e756e56bfaadc24 Mon Sep 17 00:00:00 2001 From: Davide Iadeluca Date: Tue, 30 Jul 2024 12:23:15 +0200 Subject: [PATCH] fix: change controller to handle nested data attributes --- src/Api/Controllers/UpdateHeaderItemController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Api/Controllers/UpdateHeaderItemController.php b/src/Api/Controllers/UpdateHeaderItemController.php index 58d02ca..a647321 100644 --- a/src/Api/Controllers/UpdateHeaderItemController.php +++ b/src/Api/Controllers/UpdateHeaderItemController.php @@ -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);