#5926 - Worker/PDA docuware #387

Open
jsegarra wants to merge 22 commits from 5926_pda_worker_docuware into dev
1 changed files with 8 additions and 11 deletions
Showing only changes of commit c3d08c94d1 - Show all commits

View File

@ -65,14 +65,16 @@ const handleSendToTablet = async (row) => {
console.error('Error removing department');
}
};
function checkFileFocuware({ deviceProductionFk }) {
jsegarra marked this conversation as resolved Outdated
Outdated
Review

checkFileDocuware

checkFileDocuware
return axios.post(`Docuwares/${deviceProductionFk}/checkFile`, {
fileCabinet: 'hr',
signed: true,
});
}
const handleRefreshDocuware = async (row) => {
try {
if (isProduction()) {
const { deviceProductionFk } = row;
await axios.post(`Docuwares/upload`, {
fileCabinet: 'hr',
ids: [deviceProductionFk],
});
await checkFileFocuware(row);
}
notify(t('PDA Signed'), 'positive');
row.isSigned = true;
@ -96,12 +98,7 @@ const handleDownloadDocuware = async (row) => {
};
async function fetchDocuware(deviceProductions) {
let promises = deviceProductions.map(({ deviceProductionFk }) =>
axios.post(`Docuwares/${deviceProductionFk}/checkFile`, {
fileCabinet: 'hr',
signed: true,
})
);
let promises = deviceProductions.map((device) => checkFileFocuware(device));
promises = await Promise.all(promises);
promises.forEach((promise) => {
const id = +promise.config.url.match(/\d+/)[0];