I'm trying to handle server validation errors once submission of a SimpleForm has been done.
My form is quite easily created:
<SimpleForm onSubmit={submitResults}>
<UserForm />
</SimpleForm>
And I have a simple way to throw a submission error, not calling the server for the moment:
const submitResults = (values) => {
throw new SubmissionError({firstname: "Firstname is wrong", lastname: "Lastname is not good", _error: "Submit Failed"});
};
According to https://marmelab.com/admin-on-rest/CreateEdit.html#validation and Redux Form, this should be fine: https://redux-form.com/6.5.0/examples/submitvalidation/.
However, I don't enter submitResults function, and the submission is made to the server which returns a 401 status which never gets understood.
What's wrong with this approach?