feat: existingRefund without ticketRefund
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
d31340ff25
commit
1cf14035d5
|
@ -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