componentUpdate

This commit is contained in:
Bernat Exposito Domenech 2020-02-25 12:36:33 +01:00
parent 2fdd275085
commit 85db094f1d
1 changed files with 6 additions and 2 deletions

View File

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