chore: refs #7919 change var name
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jorge Penadés 2024-10-16 09:23:39 +02:00
parent d57f4fc44a
commit 8ca097d4a9
1 changed files with 3 additions and 3 deletions

View File

@ -49,12 +49,12 @@ module.exports = Self => {
where: {originalTicketFk: id} where: {originalTicketFk: id}
}, myOptions); }, myOptions);
const isRefund = !!ticketRefunds?.length; const hasRefund = !!ticketRefunds?.length;
const allDeleted = ticketRefunds.every(refund => refund.refundTicket().isDeleted); const allDeleted = ticketRefunds.every(refund => refund.refundTicket().isDeleted);
if (!isRefund) await models.TicketRefund.destroyAll({refundTicketFk: id}, myOptions); if (!hasRefund) await models.TicketRefund.destroyAll({refundTicketFk: id}, myOptions);
if (isRefund && !allDeleted) { if (hasRefund && !allDeleted) {
const notDeleted = []; const notDeleted = [];
for (const refund of ticketRefunds) for (const refund of ticketRefunds)
if (!refund.refundTicket().isDeleted) notDeleted.push(refund.refundTicket().id); if (!refund.refundTicket().isDeleted) notDeleted.push(refund.refundTicket().id);