forked from verdnatura/salix-front
feat: #5926 resolve comments
This commit is contained in:
parent
8c1048b5af
commit
67cd4f9212
|
@ -62,10 +62,10 @@ const handleSendToTablet = async (row) => {
|
|||
notify(t('PDF sended to signed'), 'positive');
|
||||
row.isDocuware = true;
|
||||
} catch (err) {
|
||||
console.error('Error removing department');
|
||||
console.error('Error sending to sign');
|
||||
}
|
||||
};
|
||||
function checkFileFocuware({ deviceProductionFk }, signed) {
|
||||
function checkFileDocuware({ deviceProductionFk }, signed) {
|
||||
return axios.post(`Docuwares/${deviceProductionFk}/checkFile`, {
|
||||
fileCabinet: FILECABINET_ID,
|
||||
signed,
|
||||
|
@ -74,12 +74,12 @@ function checkFileFocuware({ deviceProductionFk }, signed) {
|
|||
const handleRefreshDocuware = async (row) => {
|
||||
try {
|
||||
if (isProduction()) {
|
||||
await checkFileFocuware(row, true);
|
||||
await checkFileDocuware(row, true);
|
||||
}
|
||||
notify(t('PDA Signed'), 'positive');
|
||||
row.isSigned = true;
|
||||
} catch (err) {
|
||||
console.error('Error removing department');
|
||||
console.error('Error refreshing docuware call');
|
||||
}
|
||||
};
|
||||
const handleDownloadDocuware = async (row) => {
|
||||
|
@ -93,7 +93,7 @@ const handleDownloadDocuware = async (row) => {
|
|||
}
|
||||
notify(t('PDF downloaded'), 'positive');
|
||||
} catch (err) {
|
||||
console.error('Error removing department');
|
||||
console.error('Error downloading docuware');
|
||||
}
|
||||
};
|
||||
function handlePromiseDocuware(promise, deviceProductions) {
|
||||
|
@ -105,7 +105,7 @@ function handlePromiseDocuware(promise, deviceProductions) {
|
|||
}
|
||||
async function fetchDocuware(deviceProductions) {
|
||||
const promisesIsDocuware = await Promise.allSettled(
|
||||
deviceProductions.map((device) => checkFileFocuware(device, false))
|
||||
deviceProductions.map((device) => checkFileDocuware(device, false))
|
||||
);
|
||||
|
||||
let promisesIsSigned = [];
|
||||
|
@ -115,7 +115,7 @@ async function fetchDocuware(deviceProductions) {
|
|||
|
||||
deviceProduction.isDocuware = promise.data;
|
||||
if (promise.data)
|
||||
promisesIsSigned.push(checkFileFocuware(deviceProduction, true));
|
||||
promisesIsSigned.push(checkFileDocuware(deviceProduction, true));
|
||||
});
|
||||
|
||||
promisesIsSigned = await Promise.allSettled(promisesIsSigned);
|
||||
|
|
Loading…
Reference in New Issue