Merge pull request 'hotfix-loadData' (!1696) from hotifx-loadDataDepartment into master
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #1696
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
Carlos Satorres 2023-08-02 07:08:25 +00:00
commit 6f227d45c4
1 changed files with 22 additions and 0 deletions

View File

@ -32,6 +32,28 @@ class Controller extends Descriptor {
this.vnApp.showSuccess(this.$t('Department deleted.'));
});
}
loadData() {
const filter = {
fields: ['id', 'name', 'code', 'workerFk', 'isProduction', 'chatName',
'isTeleworking', 'notificationEmail', 'hasToRefill', 'hasToSendMail', 'hasToMistake', 'clientFk'],
include: [
{relation: 'client',
scope: {
fields: ['id', 'name']
}},
{
relation: 'worker',
scope: {
fields: ['id', 'firstName', 'lastName']
}
}
]
};
return this.getData(`Departments/${this.id}`, {filter})
.then(res => this.entity = res.data);
}
}
Controller.$inject = ['$element', '$scope', '$rootScope'];