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) {
|
async function saveData(data, getChanges) {
|
||||||
const changes = getChanges();
|
const changes = getChanges();
|
||||||
if (changes?.updates?.length) {
|
if (changes?.updates?.length) {
|
||||||
try {
|
for (const change of changes.updates) {
|
||||||
for (const change of changes.updates) {
|
const row = data.find((row) => row.id === change.where.id);
|
||||||
const row = data.find((row) => row.id === change.where.id);
|
await axios.patch('FixedPrices/upsertFixedPrice', row);
|
||||||
await axios.patch('FixedPrices/upsertFixedPrice', row);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
throw error;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data?.deletes?.length) {
|
if (data?.deletes?.length) {
|
||||||
try {
|
for (const deleteItem of data.deletes) {
|
||||||
for (const deleteItem of data.deletes) {
|
await axios.delete(`FixedPrices/${deleteItem}`);
|
||||||
await axios.delete(`FixedPrices/${deleteItem}`);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
throw error;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tableRef.value.reload();
|
tableRef.value.reload();
|
||||||
|
|
Loading…
Reference in New Issue