-
Notifications
You must be signed in to change notification settings - Fork 0
Data Provider
balb0x edited this page May 30, 2021
·
3 revisions
The data provider found in this project is a modification of the base provider provided by react-admin. The following information has been extracted and modified according to the project from the react-admin Wiki.
Whenever react-admin needs to communicate with the API, it calls methods on the Data Provider object.
It’s the Data Provider’s job to turn these method calls into HTTP requests, and transform the HTTP responses to the data format expected by react-admin. In technical terms, a Data Provider is an adapter for an API.
Here is how this Data Provider maps react-admin calls to API calls:
Method | Usage | Parameters format |
---|---|---|
getList |
Search for resources | ?page={int}&row={int} |
getOne |
Read a single resource, by id | ?id={str} |
getMany |
Read a list of resource, by ids | ?ids={str},{str},... |
getManyReference |
Read a list of resources related to another one | ?id={str} |
create |
Create a single resource | { data: {Object} } |
update |
Update a single resource | { id: {mixed}, data: {Object}, previousData: {Object} } |
updateMany |
Update multiple resources | { ids: {mixed[]}, data: {Object} } |
delete |
Delete a single resource | ?id={str} |
deleteMany |
Delete multiple resources | ?ids={str},{str},... |