back errors fixed
gitea/salix/dev There was a failure building this commit Details

This commit is contained in:
Joan Sanchez 2019-08-01 11:52:53 +02:00
parent 31b5f689df
commit efeba38fb4
4 changed files with 3 additions and 7 deletions

View File

@ -25,11 +25,9 @@ export default class Controller {
const town = selection.town; const town = selection.town;
const province = town.province; const province = town.province;
const country = province.country;
this.address.city = town.name; this.address.city = town.name;
this.address.provinceFk = province.id; this.address.provinceFk = province.id;
this.address.countryFk = country.id;
} }
onResponse(response) { onResponse(response) {

View File

@ -32,11 +32,9 @@ export default class Controller {
const town = selection.town; const town = selection.town;
const province = town.province; const province = town.province;
const country = province.country;
this.address.city = town.name; this.address.city = town.name;
this.address.provinceFk = province.id; this.address.provinceFk = province.id;
this.address.countryFk = country.id;
} }
onResponse(response) { onResponse(response) {

View File

@ -63,13 +63,13 @@ module.exports = Self => {
if (!params.shipped && params.landed) { if (!params.shipped && params.landed) {
const shippedResult = await models.Agency.getShipped(params.landed, const shippedResult = await models.Agency.getShipped(params.landed,
address.id, params.agencyModeFk, params.warehouseFk); address.id, params.agencyModeFk, params.warehouseFk);
params.shipped = shippedResult.shipped; params.shipped = shippedResult && shippedResult.shipped;
} }
if (params.shipped && !params.landed) { if (params.shipped && !params.landed) {
const landedResult = await models.Agency.getLanded(params.shipped, const landedResult = await models.Agency.getLanded(params.shipped,
address.id, params.agencyModeFk, params.warehouseFk); address.id, params.agencyModeFk, params.warehouseFk);
params.landed = landedResult.landed; params.landed = landedResult && landedResult.landed;
} }
if (!params.userId && ctx.req && ctx.req.accessToken.userId) if (!params.userId && ctx.req && ctx.req.accessToken.userId)

View File

@ -63,7 +63,7 @@ module.exports = Self => {
if (!isProductionBoss) { if (!isProductionBoss) {
const zone = await models.Agency.getShipped(landed, addressId, agencyModeId, warehouseId); 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`); throw new UserError(`You don't have privileges to change the zone`);
} }