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