change receiver to requesterId
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Vicent Llopis 2021-10-27 12:22:32 +02:00
parent d94e2900d0
commit f60fa5a852
1 changed files with 3 additions and 6 deletions

View File

@ -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();