-
Notifications
You must be signed in to change notification settings - Fork 526
Closed
Description
In version v2.0.8 we now have deepMerge support, and it almost works, but there's one important issue that prevent's us from just using
'users' => Inertia::deepMerge(UserResource::collection(User::paginate()))
because in laravel it returns data with this structure
data: [/* items */],
meta: {
...,
links: [
/* list of pagination links */
]
},
links: { /* pagination links */ }
and in packages/core/src/response.ts mergeProps functions is recursively called on objects, so after each request with deepMerge new items keep adding to meta.links array.
Maybe not everyone project uses meta.links to renter pagination links, but if you use it, then deepMerge becomes useless.
I was considering adding second argument to Inertia::deepMerge to specify list of keys to exclude from merging and transferring that array to js, but i'm not sure how flexible it would be with deeply nested keys.
Metadata
Metadata
Assignees
Labels
No labels