log in ticketUpdate

This commit is contained in:
Bernat Exposito Domenech 2020-02-25 11:43:50 +01:00
parent 7c1a13cca8
commit 2fdd275085
1 changed files with 6 additions and 1 deletions

View File

@ -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,