This commit is contained in:
parent
83d0a394e3
commit
26d6bbff4c
|
@ -1,4 +1,5 @@
|
|||
const loggable = require('vn-loopback/util/log');
|
||||
const UserError = require('vn-loopback/util/user-error');
|
||||
|
||||
module.exports = Self => {
|
||||
Self.remoteMethodCtx('componentUpdate', {
|
||||
|
@ -112,7 +113,6 @@ module.exports = Self => {
|
|||
}
|
||||
|
||||
try {
|
||||
const userId = ctx.req.accessToken.userId;
|
||||
const models = Self.app.models;
|
||||
const $t = ctx.req.__; // $translate
|
||||
await models.Ticket.isEditableOrThrow(ctx, args.id, myOptions);
|
||||
|
@ -127,11 +127,8 @@ module.exports = Self => {
|
|||
args.warehouseFk,
|
||||
myOptions);
|
||||
|
||||
if (!zoneShipped || zoneShipped.zoneFk != args.zoneFk) {
|
||||
const error = `You don't have privileges to change the zone`;
|
||||
|
||||
throw new UserError(error);
|
||||
}
|
||||
if (!zoneShipped || zoneShipped.zoneFk != args.zoneFk)
|
||||
throw new UserError(`You don't have privileges to change the zone`);
|
||||
}
|
||||
|
||||
if (args.isWithoutNegatives) {
|
||||
|
|
Loading…
Reference in New Issue