-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFR] Support API empty response on DELETE and DELETE_MANY actions #3441
Conversation
docs/DataProviders.md
Outdated
@@ -467,8 +467,8 @@ Request Type | Response format | |||
`CREATE` | `{ data: {Record} }` | |||
`UPDATE` | `{ data: {Record} }` | |||
`UPDATE_MANY` | `{ data: {mixed[]} }` The ids which have been updated | |||
`DELETE` | `{ data: {Record} }` | |||
`DELETE_MANY` | `{ data: {mixed[]} }` The ids which have been deleted | |||
`DELETE` | `{ data: {Record} }` The resource that had been deleted or nothing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`DELETE` | `{ data: {Record} }` The resource that had been deleted or nothing | |
`DELETE` | `{ data: {Record} }` The record that has been deleted |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would precise, to the data provider maintainers that this data isn't required.
docs/DataProviders.md
Outdated
`DELETE` | `{ data: {Record} }` | ||
`DELETE_MANY` | `{ data: {mixed[]} }` The ids which have been deleted | ||
`DELETE` | `{ data: {Record} }` The resource that had been deleted or nothing | ||
`DELETE_MANY` | `{ data: {mixed[]} }` The ids which have been deleted or an empty array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`DELETE_MANY` | `{ data: {mixed[]} }` The ids which have been deleted or an empty array | |
`DELETE_MANY` | `{ data: {mixed[]} }` The ids of the deleted records |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idem, I would precise, to the data provider maintainers that this data isn't required.
Any update ? |
Co-Authored-By: Francois Zaninotto <francois@marmelab.com>
Co-Authored-By: Francois Zaninotto <francois@marmelab.com>
Co-Authored-By: Francois Zaninotto <francois@marmelab.com>
95d3ccf
to
f67c27d
Compare
f67c27d
to
29d1670
Compare
Reviews applied and rebased |
Ok, I checked for both
DELETE
andDELETE_MANY
actions.DELETE
doesn't require to have an identifier ({ data: { id: 'id' } }
) but needs to have a data key, which should be returned by the data providerDELETE_MANY
should return a data as a array, but do not require to have something in that array. If the API doesn't return a response, the data provider will return an empty arrayNote : It is possible for the data provider to return the ids or resources sent with the request thanks to the
params
argument, but since react admin does nothing with this data, I preferred to remove not require it.