This commit is contained in:
parent
c7da71d8c0
commit
0d980334b8
|
@ -63,10 +63,11 @@ module.exports = Self => {
|
|||
newInstance: {mergedTicket: ticket.originId}
|
||||
};
|
||||
|
||||
await models.TicketLog.create(ticketDestinationLogRecord, myOptions);
|
||||
await models.Sale.updateAll({ticketFk: ticket.originId}, {ticketFk: ticket.destinationId}, myOptions);
|
||||
await models.Ticket.setDeleted(ctx, ticket.originId, myOptions);
|
||||
await models.Chat.sendCheckingPresence(ctx, ticket.workerFk, message);
|
||||
if (await models.Ticket.setDeleted(ctx, ticket.originId, myOptions)) {
|
||||
await models.TicketLog.create(ticketDestinationLogRecord, myOptions);
|
||||
await models.Chat.sendCheckingPresence(ctx, ticket.workerFk, message);
|
||||
}
|
||||
}
|
||||
if (tx)
|
||||
await tx.commit();
|
||||
|
|
|
@ -36,6 +36,9 @@ module.exports = Self => {
|
|||
}
|
||||
|
||||
try {
|
||||
const ticketToDelete = await models.Ticket.findById(id, {fields: ['isDeleted']}, myOptions);
|
||||
if (ticketToDelete.isDeleted) return false;
|
||||
|
||||
const userId = ctx.req.accessToken.userId;
|
||||
const isEditable = await Self.isEditable(ctx, id, myOptions);
|
||||
|
||||
|
|
Loading…
Reference in New Issue