diff --git a/modules/worker/front/department/descriptor/index.html b/modules/worker/front/department/descriptor/index.html index b1f7f21e3..7cf1a2c35 100644 --- a/modules/worker/front/department/descriptor/index.html +++ b/modules/worker/front/department/descriptor/index.html @@ -5,7 +5,6 @@ Delete diff --git a/modules/worker/front/department/descriptor/index.js b/modules/worker/front/department/descriptor/index.js index 8ead3affd..388a7f776 100644 --- a/modules/worker/front/department/descriptor/index.js +++ b/modules/worker/front/department/descriptor/index.js @@ -23,13 +23,11 @@ class Controller extends Descriptor { this.$state.go(`worker.index`, {q: JSON.stringify({departmentFk: department.id})}); } + deleteDepartment() { - return this.$http.post(`Departments/${this.id}/setDeleted`) - .then(() => this.reload()) + return this.$http.delete(`Departments/${this.id}`) .then(() => { - const isInsideDepartment = this.$state.current.name.startsWith('department'); - if (isInsideDepartment) - this.$state.go('department.index'); + this.$state.go('worker.department'); this.vnApp.showSuccess(this.$t('Department deleted.')); }); diff --git a/modules/worker/front/department/index.js b/modules/worker/front/department/index.js index 71846f77c..8699252bd 100644 --- a/modules/worker/front/department/index.js +++ b/modules/worker/front/department/index.js @@ -5,3 +5,4 @@ import './card'; import './descriptor'; import './basic-data'; import './search-panel'; +import './descriptor-popover'; diff --git a/modules/worker/front/routes.json b/modules/worker/front/routes.json index 7ac692391..c532efde7 100644 --- a/modules/worker/front/routes.json +++ b/modules/worker/front/routes.json @@ -3,7 +3,7 @@ "name": "Workers", "icon" : "icon-worker", "validations" : true, - "dependencies": ["account"], + "dependencies": ["account", "worker"], "menus": { "main": [ {"state": "worker.index", "icon": "icon-worker"}, diff --git a/modules/worker/front/summary/index.html b/modules/worker/front/summary/index.html index 89ba4a682..bde4c84f8 100644 --- a/modules/worker/front/summary/index.html +++ b/modules/worker/front/summary/index.html @@ -29,7 +29,7 @@ {{worker.department.department.name}}