added validation for the dms id field
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Jimenez Ruiz 2021-06-29 11:59:21 +02:00
parent 8ca3e0d120
commit d67e36212f
2 changed files with 20 additions and 9 deletions

View File

@ -57,15 +57,25 @@ class Controller extends Section {
}
importDms() {
const data = {
ticketFk: this.$params.id,
dmsFk: this.dmsId
};
try {
if (!this.dmsId)
throw new Error(`The document indentifier can't be empty`);
this.$http.post('ticketDms', data).then(() => {
this.vnApp.showSuccess(this.$t('Data saved!'));
this.$.model.refresh();
});
const data = {
ticketFk: this.$params.id,
dmsFk: this.dmsId
};
this.$http.post('ticketDms', data).then(() => {
this.vnApp.showSuccess(this.$t('Data saved!'));
this.dmsId = null;
this.$.model.refresh();
});
} catch (e) {
this.vnApp.showError(this.$t(e.message));
return false;
}
return true;
}
}

View File

@ -8,4 +8,5 @@ ContentTypesInfo: 'Tipos de archivo permitidos: {{allowedContentTypes}}'
Are you sure you want to continue?: ¿Seguro que quieres continuar?
File management: Gestión documental
Select document id: Introduzca id de gestion documental
Import from existing: Importar desde existente
Import from existing: Importar desde existente
The document indentifier can't be empty: El número de documento no puede estar vacío