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