feat: existingRefund without ticketRefunds
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
e2d30ef933
commit
40512ca67e
|
@ -142,12 +142,19 @@ module.exports = Self => {
|
||||||
ctx.args.addressId = ticket.addressFk;
|
ctx.args.addressId = ticket.addressFk;
|
||||||
|
|
||||||
const newTicket = await models.Ticket.new(ctx, myOptions);
|
const newTicket = await models.Ticket.new(ctx, myOptions);
|
||||||
|
const existingRefund = await models.TicketRefund.findOne({
|
||||||
await models.TicketRefund.create({
|
where: {
|
||||||
originalTicketFk: ticketId,
|
originalTicketFk: ticketId,
|
||||||
refundTicketFk: newTicket.id
|
refundTicketFk: newTicket.id
|
||||||
}, myOptions);
|
},
|
||||||
|
myOptions
|
||||||
|
});
|
||||||
|
if (!existingRefund) {
|
||||||
|
await models.TicketRefund.create({
|
||||||
|
originalTicketFk: ticketId,
|
||||||
|
refundTicketFk: newTicket.id
|
||||||
|
}, myOptions);
|
||||||
|
}
|
||||||
return newTicket;
|
return newTicket;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue