fix: fix confirmRequest #1191

Merged
carlossa merged 3 commits from hotfix-7283itemRequestConfirm into master 2025-01-09 11:53:16 +00:00
1 changed files with 12 additions and 14 deletions

View File

@ -172,24 +172,22 @@ const changeQuantity = async (request) => {
}; };
await axios.patch(`Sales/${request.saleFk}`, params); await axios.patch(`Sales/${request.saleFk}`, params);
notify(t('globals.dataSaved'), 'positive'); }
confirmRequest(request); await confirmRequest(request);
} else confirmRequest(request); notify(t('globals.dataSaved'), 'positive');
}; };
const confirmRequest = async (request) => { const confirmRequest = async (request) => {
if (request.itemFk && request.saleQuantity) { if (!request.itemFk || !request.saleQuantity) return;
const params = { const params = {
itemFk: request.itemFk, itemFk: request.itemFk,
quantity: request.saleQuantity, quantity: request.saleQuantity,
attenderFk: request.attenderFk, attenderFk: request.attenderFk,
}; };
const { data } = await axios.post(`TicketRequests/${request.id}/confirm`, params); const { data } = await axios.post(`TicketRequests/${request.id}/confirm`, params);
request.itemDescription = data.concept; request.itemDescription = data.concept;
request.isOk = true; request.isOk = true;
notify(t('globals.dataSaved'), 'positive');
}
}; };
const getState = (isOk) => { const getState = (isOk) => {