From b72e26a006e7e8e42eab8286c87b95d2df3488b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Glasn=C3=A1k?= Date: Wed, 22 Feb 2023 19:16:31 +0100 Subject: [PATCH] [Master task modal] Improved performance --- .../master-task/z-master-task-modal.vue | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/app/src/plugins/tm@modal/master-task/z-master-task-modal.vue b/app/src/plugins/tm@modal/master-task/z-master-task-modal.vue index 2b895c7..13fa0fe 100644 --- a/app/src/plugins/tm@modal/master-task/z-master-task-modal.vue +++ b/app/src/plugins/tm@modal/master-task/z-master-task-modal.vue @@ -61,7 +61,7 @@ Ukončiť mastertask - +
Pridať task @@ -90,6 +90,7 @@ import '@vueup/vue-quill/dist/vue-quill.snow.css' import SelectsMixin from './_mixins/selects.mixin' import ATasksTable from './_components/a-tasks-table.vue' import AMastertaskDescription from './_components/a-mastertask-description.vue' +import { mapGetters } from 'vuex' export default { // MIXINS @@ -115,15 +116,20 @@ export default { visible: false, errorUtils, v$: useVuelidate(), - teams: null, - projects: null, - employees: null, masterTask: null, showAddEmployeeInput: false, date: null, } }, + computed: { + ...mapGetters('tm', [ + 'teams', + 'projects', + 'enrichedEmployees' + ]) + }, + validations() { return { masterTask: { @@ -170,11 +176,6 @@ export default { this.masterTask = null try { - this.teams = await this.$axios.get_auth_data('v1/teams') - this.projects = await this.$axios.get_auth_data('v1/projects') - const employees = await this.$axios.get_auth_data('v1/employees') - this.employees = tmUtils.enrichEmployeesByFullName(employees) - if (masterTask?.id) { this.masterTask = await this.$axios.get_auth_data(`v1/mastertasks/${masterTask.id}`)