This commit is contained in:
parent
a282170016
commit
3f3b936255
|
@ -50,14 +50,12 @@ module.exports = Self => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const promises = [];
|
|
||||||
|
|
||||||
const ticketList = await models.Ticket.find(filter, myOptions);
|
const ticketList = await models.Ticket.find(filter, myOptions);
|
||||||
|
|
||||||
if (ticketList.length > 0)
|
if (ticketList.length > 0)
|
||||||
throw new UserError('There are tickets for this area, delete them first');
|
throw new UserError('There are tickets for this area, delete them first');
|
||||||
|
|
||||||
await Promise.all(promises);
|
|
||||||
await models.Zone.destroyById(id, myOptions);
|
await models.Zone.destroyById(id, myOptions);
|
||||||
|
|
||||||
if (tx) await tx.commit();
|
if (tx) await tx.commit();
|
||||||
|
|
Loading…
Reference in New Issue