mirror of
https://github.com/lemeow125/Borrowing-TrackerFrontend.git
synced 2025-09-17 04:59:35 +08:00
Added update transaction modal and simplified error handling for update APIs
This commit is contained in:
parent
d226d77306
commit
d2521a628d
6 changed files with 258 additions and 8 deletions
|
@ -53,6 +53,7 @@ export default function EditSKUModal(props: {
|
|||
mutationFn: async () => {
|
||||
const data = await EquipmentUpdateAPI(item, props.id);
|
||||
if (data[0] != true) {
|
||||
setError(JSON.stringify(data[1]));
|
||||
return Promise.reject(new Error(JSON.stringify(data[1])));
|
||||
}
|
||||
return data;
|
||||
|
@ -87,9 +88,6 @@ export default function EditSKUModal(props: {
|
|||
});
|
||||
}
|
||||
},
|
||||
onError: (error) => {
|
||||
setError(JSON.stringify(error));
|
||||
},
|
||||
});
|
||||
|
||||
const delete_mutation = useMutation({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue