Handle errors properly from the API

This commit is contained in:
jude 2025-03-20 16:40:43 +00:00
parent a604e4d191
commit cf84315fdd

View File

@ -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);