-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Francois, I need in your advice. Could you please help me?
WHAT I WANT TO DO
I created custom form. It is custom because:
- Form include a lot of custom elements, which can't be done by React-Admin functionality;
- Some values should be calculated automatically
When this form is submited, I run request by custom data provider:
submitForm = data => {
.....
// Some actions, calculations etc.
.....
const formData = Object.assign({}, data, additionalData);
if (isCreate) {
customDataProvider(CREATE, 'vitalsigns', { data: formData });
} else {
.......
// Some actions
......
customDataProvider(UPDATE, 'vitalsigns', { id: id, data: formData });
}
history.push('/vitalsigns');
};
WHERE IS PROBLEM:
Request from the client side to the server side was sent correctly.
But data in Store isn't updated. Values in React-store are the same, which was before form submitting:

All other plugins, where we use React-Admin forms (like Allergies), data updates automatically.
Why data in React-store isn't updated automatically?
Could you please help me to find a reason, why data wasn't updated? And how to provide data updating?
My Form:
https://github.com/PulseTile/PulseTile-RA/blob/showcase/src/version/plugins/Vitals/fragments/Form.js
My Custom data Provider:
https://github.com/PulseTile/PulseTile-RA/blob/showcase/src/core/dataProviders/dataProvider.js
