refactor: refs #8944 deleted useless try catch
This commit is contained in:
parent
5523362175
commit
81c5f78751
|
@ -227,23 +227,15 @@ const onDataSaved = () => {
|
|||
async function saveData(data, getChanges) {
|
||||
const changes = getChanges();
|
||||
if (changes?.updates?.length) {
|
||||
try {
|
||||
for (const change of changes.updates) {
|
||||
const row = data.find((row) => row.id === change.where.id);
|
||||
await axios.patch('FixedPrices/upsertFixedPrice', row);
|
||||
}
|
||||
} catch (error) {
|
||||
throw error;
|
||||
for (const change of changes.updates) {
|
||||
const row = data.find((row) => row.id === change.where.id);
|
||||
await axios.patch('FixedPrices/upsertFixedPrice', row);
|
||||
}
|
||||
}
|
||||
|
||||
if (data?.deletes?.length) {
|
||||
try {
|
||||
for (const deleteItem of data.deletes) {
|
||||
await axios.delete(`FixedPrices/${deleteItem}`);
|
||||
}
|
||||
} catch (error) {
|
||||
throw error;
|
||||
for (const deleteItem of data.deletes) {
|
||||
await axios.delete(`FixedPrices/${deleteItem}`);
|
||||
}
|
||||
}
|
||||
tableRef.value.reload();
|
||||
|
|
Loading…
Reference in New Issue