diff --git a/modules/client/front/address/create/index.js b/modules/client/front/address/create/index.js index bcccc0730..3cd8af614 100644 --- a/modules/client/front/address/create/index.js +++ b/modules/client/front/address/create/index.js @@ -25,11 +25,9 @@ export default class Controller { const town = selection.town; const province = town.province; - const country = province.country; this.address.city = town.name; this.address.provinceFk = province.id; - this.address.countryFk = country.id; } onResponse(response) { diff --git a/modules/client/front/address/edit/index.js b/modules/client/front/address/edit/index.js index 76bde9e0f..02fe19658 100644 --- a/modules/client/front/address/edit/index.js +++ b/modules/client/front/address/edit/index.js @@ -32,11 +32,9 @@ export default class Controller { const town = selection.town; const province = town.province; - const country = province.country; this.address.city = town.name; this.address.provinceFk = province.id; - this.address.countryFk = country.id; } onResponse(response) { diff --git a/modules/ticket/back/methods/ticket/new.js b/modules/ticket/back/methods/ticket/new.js index 5bfb1996e..25e5a08c5 100644 --- a/modules/ticket/back/methods/ticket/new.js +++ b/modules/ticket/back/methods/ticket/new.js @@ -63,13 +63,13 @@ module.exports = Self => { if (!params.shipped && params.landed) { const shippedResult = await models.Agency.getShipped(params.landed, address.id, params.agencyModeFk, params.warehouseFk); - params.shipped = shippedResult.shipped; + params.shipped = shippedResult && shippedResult.shipped; } if (params.shipped && !params.landed) { const landedResult = await models.Agency.getLanded(params.shipped, address.id, params.agencyModeFk, params.warehouseFk); - params.landed = landedResult.landed; + params.landed = landedResult && landedResult.landed; } if (!params.userId && ctx.req && ctx.req.accessToken.userId) diff --git a/modules/ticket/back/methods/ticket/priceDifference.js b/modules/ticket/back/methods/ticket/priceDifference.js index 96c34d252..552c2b991 100644 --- a/modules/ticket/back/methods/ticket/priceDifference.js +++ b/modules/ticket/back/methods/ticket/priceDifference.js @@ -63,7 +63,7 @@ module.exports = Self => { if (!isProductionBoss) { const zone = await models.Agency.getShipped(landed, addressId, agencyModeId, warehouseId); - if (zone.id != zoneId) + if (!zone || zone.id != zoneId) throw new UserError(`You don't have privileges to change the zone`); }