Handle validation error toasts
This commit is contained in:
parent
40ef719f2f
commit
ec586191e7
|
@ -58,7 +58,14 @@ export const API = createAPIClient({
|
|||
}
|
||||
}
|
||||
if (!ignore) {
|
||||
notificationStore.actions.error(message)
|
||||
const validationErrors = error?.json?.validationErrors
|
||||
if (validationErrors) {
|
||||
for (let field in validationErrors) {
|
||||
notificationStore.actions.error(`${field} ${validationErrors[field]}`)
|
||||
}
|
||||
} else {
|
||||
notificationStore.actions.error(message)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue