refs #4770 manejo de errores
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Vicent Llopis 2023-05-11 07:32:23 +02:00
parent 2ba333e714
commit af1c080e0c
2 changed files with 5 additions and 4 deletions

View File

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

View File

@ -1,2 +1,3 @@
Stops: Paradas
Wharehouse: Almacén
You must fill all the fields: Debes rellenar todos los campos