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;
|
||||
|
||||
const newTicket = await models.Ticket.new(ctx, myOptions);
|
||||
|
||||
await models.TicketRefund.create({
|
||||
originalTicketFk: ticketId,
|
||||
refundTicketFk: newTicket.id
|
||||
}, myOptions);
|
||||
|
||||
const existingRefund = await models.TicketRefund.findOne({
|
||||
where: {
|
||||
originalTicketFk: ticketId,
|
||||
refundTicketFk: newTicket.id
|
||||
},
|
||||
myOptions
|
||||
});
|
||||
if (!existingRefund) {
|
||||
await models.TicketRefund.create({
|
||||
originalTicketFk: ticketId,
|
||||
refundTicketFk: newTicket.id
|
||||
}, myOptions);
|
||||
}
|
||||
return newTicket;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue