From 85db094f1d9578d99a5745312f040cf26fa16c7f Mon Sep 17 00:00:00 2001 From: Bernat Exposito Domenech Date: Tue, 25 Feb 2020 12:36:33 +0100 Subject: [PATCH] componentUpdate --- modules/ticket/back/methods/ticket/componentUpdate.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/ticket/back/methods/ticket/componentUpdate.js b/modules/ticket/back/methods/ticket/componentUpdate.js index 4d05e28d6..3447f52bf 100644 --- a/modules/ticket/back/methods/ticket/componentUpdate.js +++ b/modules/ticket/back/methods/ticket/componentUpdate.js @@ -88,13 +88,17 @@ 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 originalTicket = await models.Ticket.findById(id, {fields: + ['id', 'clientFk', 'agencyModeFk', 'addressFk', 'zoneFk', + 'warehouseFk', 'companyFk', 'shipped', 'landed', 'isDeleted'] + }); const properties = Object.assign({}, ctx.args); delete properties.ctx; delete properties.option; // Force unroute const hasToBeUnrouted = true; - console.log('args', originalTicket); + console.log('originalTicket', originalTicket); + console.log('properties', properties); let query = 'CALL vn.ticket_componentMakeUpdate(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'; let res = await Self.rawSql(query, [ id,