@@ -466,11 +474,13 @@ const lockIconType = (groupingMode, mode) => {
diff --git a/src/pages/Worker/CreateDepartmentChild.vue b/src/pages/Worker/CreateDepartmentChild.vue
index 1f1b1335b..bde2b480a 100644
--- a/src/pages/Worker/CreateDepartmentChild.vue
+++ b/src/pages/Worker/CreateDepartmentChild.vue
@@ -40,6 +40,7 @@ onMounted(() => {
{
const { id, parentFk } = node;
quasar
.dialog({
- title: t('Are you sure you want to delete it?'),
- message: t('Delete department'),
- ok: {
- push: true,
- color: 'primary',
+ component: VnConfirm,
+ componentProps: {
+ title: t('Are you sure you want to delete it?'),
+ message: t('Delete department'),
+ promise: () => remove(id),
},
- cancel: true,
})
- .onOk(async () => {
- try {
- await axios.post(`/Departments/${id}/removeChild`, id);
- notify(t('department.departmentRemoved'), 'positive');
- await fetchNodeLeaves(parentFk);
- } catch (err) {
- console.error('Error removing department');
- }
- });
+ .onOk(async () => await fetchNodeLeaves(parentFk));
};
+async function remove(id) {
+ try {
+ await axios.post(`/Departments/${id}/removeChild`, { id });
+ quasar.notify({
+ message: t('department.departmentRemoved'),
+ type: 'positive',
+ });
+ } catch (err) {
+ console.error('Error removing department');
+ }
+}
+
const showCreateNodeForm = (nodeId) => {
showCreateNodeFormVal.value = true;
creationNodeSelectedId.value = nodeId;