Skip to content
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

[Doc] Improve server side validation example #8378

Merged
merged 4 commits into from
Nov 10, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update docs/Validation.md
Co-authored-by: Jean-Baptiste Kaiser <jb@marmelab.com>
  • Loading branch information
WiXSL and slax57 authored Nov 10, 2022
commit 2e27846039885f2a0ff5aaf4d2551ee449c46a7f
16 changes: 6 additions & 10 deletions docs/Validation.md
Original file line number Diff line number Diff line change
@@ -381,17 +381,13 @@ export const UserCreate = () => {
await create(
'users',
{ data: values },
{
returnPromise: true,
onSuccess: () => {
notify('ra.notification.created', {
type: 'info',
messageArgs: { smart_count: 1 },
});
redirect('list');
},
}
{ returnPromise: true }
);
notify('ra.notification.created', {
type: 'info',
messageArgs: { smart_count: 1 },
});
redirect('list');
} catch (error) {
if (error.body.errors) {
// The shape of the returned validation errors must match the shape of the form