diff --git a/modules/ticket/back/methods/ticket-request/deny.js b/modules/ticket/back/methods/ticket-request/deny.js index 6d7df32aa..35de765d7 100644 --- a/modules/ticket/back/methods/ticket-request/deny.js +++ b/modules/ticket/back/methods/ticket-request/deny.js @@ -50,19 +50,16 @@ module.exports = Self => { const request = await Self.app.models.TicketRequest.findById(ctx.args.id, null, myOptions); await request.updateAttributes(params, myOptions); - // const salesPerson = ticket.client().salesPersonUser(); - // if (salesPerson) { - // const origin = ctx.req.headers.origin; const origin = ctx.req.headers.origin; + const requesterId = request.requesterFk; const message = $t('Deny buy request', { ticketId: request.ticketFk, url: `${origin}/#!/ticket/${request.ticketFk}/request/index`, observation: params.response }); - // await models.Chat.sendCheckingPresence(ctx, salesPerson.id, message, myOptions); - await models.Chat.send(ctx, '@vicent', message, myOptions); - // } + + await models.Chat.sendCheckingPresence(ctx, requesterId, message, myOptions); if (tx) await tx.commit();