fix: trycatch
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Javier Segarra 2025-02-18 12:12:37 +01:00
parent c86601d548
commit 209814e477
1 changed files with 14 additions and 19 deletions

View File

@ -132,27 +132,22 @@ const getInputEvents = ({ col, ...rows }) => ({
'keyup.enter': () => saveChange(col.name, rows),
});
const saveChange = async (field, { row }) => {
try {
switch (field) {
case 'alertLevelCode':
await axios.post(`Tickets/state`, {
ticketFk: row.ticketFk,
code: row[field],
});
break;
switch (field) {
case 'alertLevelCode':
await axios.post(`Tickets/state`, {
ticketFk: row.ticketFk,
code: row[field],
});
break;
case 'quantity':
await axios.post(`Sales/${row.saleFk}/updateQuantity`, {
quantity: +row.quantity,
});
break;
}
notify('globals.dataSaved', 'positive');
fetchItemLack.value.fetch();
} catch (err) {
console.error('Error saving changes', err);
f;
case 'quantity':
await axios.post(`Sales/${row.saleFk}/updateQuantity`, {
quantity: +row.quantity,
});
break;
}
notify('globals.dataSaved', 'positive');
fetchItemLack.value.fetch();
};
function onBuysFetched(data) {