7806_devToTest_2332 #2801
|
@ -40,8 +40,6 @@ module.exports = Self => {
|
|||
});
|
||||
const {code} = expedition.agencyMode();
|
||||
|
||||
let isDeleted = true;
|
||||
|
||||
if (code?.toLowerCase()?.includes('mrw') && expedition.externalId) {
|
||||
const result = await models.MrwConfig.cancelShipment(expeditionId);
|
||||
if (!result) throw new Error('not deleted');
|
||||
|
@ -52,14 +50,9 @@ module.exports = Self => {
|
|||
if (result !== 'true') throw new Error('not deleted');
|
||||
}
|
||||
|
||||
if (!isDeleted)
|
||||
notDeletedExpeditions.push(expeditionId);
|
||||
else {
|
||||
const deletedExpedition = await models.Expedition.destroyById(expeditionId);
|
||||
deletedExpeditions.push(deletedExpedition);
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('e: ', e);
|
||||
notDeletedExpeditions.push(expeditionId);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue