codigo innecesario
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Vicent Llopis 2023-06-20 11:28:25 +02:00
parent cea6fae649
commit e99627c0b2
1 changed files with 7 additions and 9 deletions

View File

@ -81,17 +81,15 @@ module.exports = Self => {
throw new UserError('You must delete all the buy requests first');
// removes item shelvings
if (hasItemShelvingSales && canDeleteTicketWithPartPrepared) {
const promises = [];
for (let sale of sales) {
if (sale.itemShelvingSale()) {
const itemShelvingSale = sale.itemShelvingSale();
const destroyedShelving = models.ItemShelvingSale.destroyById(itemShelvingSale.id, myOptions);
promises.push(destroyedShelving);
}
const promises = [];
for (let sale of sales) {
if (sale.itemShelvingSale()) {
const itemShelvingSale = sale.itemShelvingSale();
const destroyedShelving = models.ItemShelvingSale.destroyById(itemShelvingSale.id, myOptions);
promises.push(destroyedShelving);
}
await Promise.all(promises);
}
await Promise.all(promises);
// Remove ticket greuges
const ticketGreuges = await models.Greuge.find({where: {ticketFk: id}}, myOptions);