refactor: delete code repeated
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Vicent Llopis 2022-10-17 14:01:21 +02:00
parent 787d10aac6
commit f85c2e9700
1 changed files with 2 additions and 3 deletions

View File

@ -140,10 +140,9 @@ module.exports = Self => {
componentFk: oldComponent.componentFk componentFk: oldComponent.componentFk
}; };
await models.SaleComponent.destroyAll(filter, myOptions); await models.SaleComponent.destroyAll(filter, myOptions);
}
await createSaleComponent(sale.id, value, componentId, myOptions); await createSaleComponent(sale.id, value, componentId, myOptions);
} else
await createSaleComponent(sale.id, value, componentId, myOptions);
const updatedSale = sale.updateAttribute('discount', newDiscount, myOptions); const updatedSale = sale.updateAttribute('discount', newDiscount, myOptions);