From 2fdd2750852fcafcda70b8437b6a89e4f0cead40 Mon Sep 17 00:00:00 2001 From: Bernat Exposito Domenech Date: Tue, 25 Feb 2020 11:43:50 +0100 Subject: [PATCH] log in ticketUpdate --- modules/ticket/back/methods/ticket/componentUpdate.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/ticket/back/methods/ticket/componentUpdate.js b/modules/ticket/back/methods/ticket/componentUpdate.js index 2cba62540..4d05e28d6 100644 --- a/modules/ticket/back/methods/ticket/componentUpdate.js +++ b/modules/ticket/back/methods/ticket/componentUpdate.js @@ -1,4 +1,5 @@ const UserError = require('vn-loopback/util/user-error'); +const diff = require('object-diff'); module.exports = Self => { Self.remoteMethodCtx('componentUpdate', { @@ -87,9 +88,13 @@ module.exports = Self => { if (!zoneShipped || zoneShipped.zoneFk != zoneId) throw new UserError(`You don't have privileges to change the zone`); } - + const originalTicket = await models.Ticket.findById(id); + const properties = Object.assign({}, ctx.args); + delete properties.ctx; + delete properties.option; // Force unroute const hasToBeUnrouted = true; + console.log('args', originalTicket); let query = 'CALL vn.ticket_componentMakeUpdate(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'; let res = await Self.rawSql(query, [ id,