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