From 5f43c0440c0e0710497624993915b0ce63dec196 Mon Sep 17 00:00:00 2001 From: carlossa Date: Mon, 16 Dec 2024 11:58:21 +0100 Subject: [PATCH] fix: refs #7028 requesterId fix salesPerson --- modules/ticket/back/methods/ticket-request/confirm.js | 6 +++--- modules/ticket/back/methods/ticket-request/deny.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/ticket/back/methods/ticket-request/confirm.js b/modules/ticket/back/methods/ticket-request/confirm.js index ab4d39d51..45ee287de 100644 --- a/modules/ticket/back/methods/ticket-request/confirm.js +++ b/modules/ticket/back/methods/ticket-request/confirm.js @@ -97,8 +97,8 @@ module.exports = Self => { const query = `CALL vn.sale_calculateComponent(?, NULL)`; await Self.rawSql(query, [sale.id], myOptions); - const requesterId = request.ticket().client().salesPersonFk; - if (requesterId) { + const salesPerson = request.ticket().client().salesPersonFk; + if (salesPerson) { const url = await Self.app.models.Url.getUrl(); const message = $t('Bought units from buy request', { quantity: sale.quantity, @@ -108,7 +108,7 @@ module.exports = Self => { url: `${url}ticket/${sale.ticketFk}/summary`, urlItem: `${url}item/${sale.itemFk}/summary` }); - await models.Chat.sendCheckingPresence(ctx, requesterId, message, myOptions); + await models.Chat.sendCheckingPresence(ctx, salesPerson, message, myOptions); } if (tx) await tx.commit(); diff --git a/modules/ticket/back/methods/ticket-request/deny.js b/modules/ticket/back/methods/ticket-request/deny.js index 686b9d1de..26e6f63ff 100644 --- a/modules/ticket/back/methods/ticket-request/deny.js +++ b/modules/ticket/back/methods/ticket-request/deny.js @@ -65,8 +65,8 @@ module.exports = Self => { } }, myOptions); - const requesterId = request.ticket().client().salesPersonFk; - if (requesterId) { + const salesPerson = request.ticket().client().salesPersonFk; + if (salesPerson) { const url = await models.Url.getUrl(); const message = $t('Deny buy request', { ticketId: request.ticketFk, @@ -74,7 +74,7 @@ module.exports = Self => { observation: params.response }); - await models.Chat.sendCheckingPresence(ctx, requesterId, message, myOptions); + await models.Chat.sendCheckingPresence(ctx, salesPerson, message, myOptions); await request.updateAttributes(params, myOptions); }