Handle errors properly from the API
This commit is contained in:
1 parent
a604e4d191
commit
cf84315fdd
1 file changed
+2
-4
@@ -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);
|
||||
|
||||
|
||||
Reference in new issue
Block a user