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); clearTimeout(iconFlashTimeout.current);
} }
if (response.data.errors.length > 0) { if (response.data.error) {
setRecentlySaved(false); setRecentlySaved(false);
for (const error of response.data.errors) { flash({ message: response.data.error, type: "error" });
flash({ message: error, type: "error" });
}
} else { } else {
setRecentlySaved(true); setRecentlySaved(true);