fix(deletExpeditions): merge test → dev
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
b9c57c2f0e
commit
513b4583b3
|
@ -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