api-platform / admin

A beautiful and fully-featured administration interface builder for hypermedia APIs
https://api-platform.com/docs/admin/
MIT License
481 stars 130 forks source link

fix(dataProvider): fix itemUrl declaration #392

Closed Jisay closed 3 years ago

Jisay commented 3 years ago
Q A
Branch? main for features / current stable version branch for bug fixes
Tickets #380
License MIT

Fix itemUrl in convertReactAdminRequestToHydraRequest in order to get, update or delete a collection item with dataProvider.

dunglas commented 3 years ago

This fix doesn't look good to me. The ID of the resource must be an URI, and this URI can follow any pattern. I don't get how you get and id that's not a URI in your case, but that's what need to be fixed.

Jisay commented 3 years ago

This fix doesn't look good to me. The ID of the resource must be an URI, and this URI can follow any pattern. I don't get how you get and id that's not a URI in your case, but that's what need to be fixed.

Thx for your answer @dunglas.

So in order to user getOne, update or delete method it's required to specify id parameter like an URI? For example:

dataProvider.getOne('users', {
    id:  '/api/users/42',  // which is the full route of the resource
});

If so, it looks like strange to specify the full route as id param.