Skip to content

Commit

Permalink
Fix creating entries with JsonResource::withoutWrapping()
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmcclean committed Jan 10, 2024
1 parent 3a9e621 commit 60211b8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Http/Controllers/CP/Collections/EntriesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,10 @@ public function store(Request $request, $collection, $site)
$saved = $entry->updateLastModified(User::current())->save();
}

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

private function resolveSlug($request)
Expand Down

0 comments on commit 60211b8

Please sign in to comment.