Handle errors properly from the API
This commit is contained in:
parent
a604e4d191
commit
cf84315fdd
@ -28,12 +28,10 @@ export const EditButtonRow = () => {
|
||||
clearTimeout(iconFlashTimeout.current);
|
||||
}
|
||||
|
||||
if (response.data.errors.length > 0) {
|
||||
if (response.data.error) {
|
||||
setRecentlySaved(false);
|
||||
|
||||
for (const error of response.data.errors) {
|
||||
flash({ message: error, type: "error" });
|
||||
}
|
||||
flash({ message: response.data.error, type: "error" });
|
||||
} else {
|
||||
setRecentlySaved(true);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user