import ngModule from '../../module'; import Section from 'salix/components/section'; import './style.scss'; class Controller extends Section { constructor($element, $) { super($element, $); this.filter = { include: { relation: 'dms', scope: { fields: [ 'dmsTypeFk', 'workerFk', 'hardCopyNumber', 'reference', 'description', 'hasFile', 'file', 'created', ], include: [{ relation: 'dmsType', scope: { fields: ['name'] } }, { relation: 'worker', scope: { fields: ['userFk'], include: { relation: 'user', scope: { fields: ['nickname'] } }, } }] }, } }; } deleteDms(index) { const dmsFk = this.ticketDms[index].dmsFk; this.$http.post(`ticketDms/${dmsFk}/removeFile`) .then(() => { this.$.model.remove(index); this.vnApp.showSuccess(this.$t('Data saved!')); }); } } ngModule.component('vnTicketDmsIndex', { template: require('./index.html'), controller: Controller, });