refs #6915 master into test #2092

Merged
juan merged 22 commits from master into test 2024-02-23 18:02:08 +00:00
1 changed files with 7 additions and 1 deletions
Showing only changes of commit 277bcafd89 - Show all commits

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;
};