Skip to content

Commit

Permalink
[4.x] Fix issues when saving entries with `JsonResource::withoutWrapp…
Browse files Browse the repository at this point in the history
…ing()` (#9519)
  • Loading branch information
duncanmcclean authored Feb 16, 2024
1 parent 1d6b9b9 commit c16b576
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/Http/Controllers/CP/Collections/EntriesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,12 @@ public function update(Request $request, $collection, $entry)

[$values] = $this->extractFromFields($entry, $blueprint);

return (new EntryResource($entry->fresh()))
->additional([
'saved' => $saved,
'data' => [
'values' => $values,
],
]);
return [
'data' => array_merge((new EntryResource($entry->fresh()))->resolve()['data'], [
'values' => $values,
]),
'saved' => $saved,
];
}

public function create(Request $request, $collection, $site)
Expand Down

0 comments on commit c16b576

Please sign in to comment.