diff --git a/modules/route/front/roadmap/summary/index.js b/modules/route/front/roadmap/summary/index.js index 4dac9f7d21..08135ac555 100644 --- a/modules/route/front/roadmap/summary/index.js +++ b/modules/route/front/roadmap/summary/index.js @@ -1,6 +1,7 @@ import ngModule from '../../module'; import Component from 'core/lib/component'; import './style.scss'; +const UserError = require('vn-loopback/util/user-error'); class Controller extends Component { set roadmap(value) { @@ -34,10 +35,9 @@ class Controller extends Component { this.expeditionTruck.ETD = this.expeditionTruck.etdDate.setHours(hours, minutes); try { - // if (!this.expense.code) - // throw new Error(`The code can't be empty`); - // if (!this.expense.description) - // throw new UserError(`The description can't be empty`); + if (!this.expeditionTruck.warehouseFk || !this.expeditionTruck.etdDate || + !this.expeditionTruck.etdHour || !this.expeditionTruck.description) + throw new UserError(`You must fill all the fields`); const data = { roadmapFk: this.roadmap.id, diff --git a/modules/route/front/roadmap/summary/locale/es.yml b/modules/route/front/roadmap/summary/locale/es.yml index 3818c44982..f2d82438a8 100644 --- a/modules/route/front/roadmap/summary/locale/es.yml +++ b/modules/route/front/roadmap/summary/locale/es.yml @@ -1,2 +1,3 @@ Stops: Paradas Wharehouse: Almacén +You must fill all the fields: Debes rellenar todos los campos