fix(commit): refs #6403 hotFix add commit
gitea/salix/pipeline/pr-master There was a failure building this commit Details

This commit is contained in:
Pablo Natek 2024-02-23 14:11:11 +01:00
parent 03550573b0
commit 277bcafd89
1 changed files with 7 additions and 1 deletions

View File

@ -86,7 +86,13 @@ module.exports = Self => {
const getLabelResponse = await sendXmlDoc('getLabel', {mrw, shipmentId}, 'text/xml');
const file = getTextByTag(getLabelResponse, 'EtiquetaFile');
await models.Expedition.updateAll({id: expeditionFk}, {externalId: shipmentId}, myOptions);
try {
await models.Expedition.updateAll({id: expeditionFk}, {externalId: shipmentId}, myOptions);
await myOptions.transaction.commit();
} catch (error) {
await myOptions.transaction.rollback();
throw new UserError(`Cant update the expedition`);
}
return file;
};