@@ -19,7 +19,7 @@ import AHeader from './_components/a-header.vue' export default { components: { ASidemenu, - // AHeader + AHeader } } diff --git a/app/src/plugins/tm@dashboard/teams/_components/a-team-filter.vue b/app/src/plugins/tm@dashboard/teams/_components/a-team-filter.vue index 69c6722..eee29bb 100644 --- a/app/src/plugins/tm@dashboard/teams/_components/a-team-filter.vue +++ b/app/src/plugins/tm@dashboard/teams/_components/a-team-filter.vue @@ -44,7 +44,7 @@ export default { return { teams: [], teamsNames: [], - + // Kaluza: Napojit funkcionalitu selectedTeam: '', @@ -74,7 +74,7 @@ export default { }, async _getTeams() { - this.teams = await this.$axios.get_auth_data('v1/teams') + this.teams = await this.$axios.get_auth_data('v1/teamsx') this.teams.forEach(team => { this.teamsNames.push(team.name) }) 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 3e574b9..57fa755 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 @@ -348,12 +348,12 @@ export default { async created() { try { - this.teams = await this.$axios.get_auth_data('v1/teams') + this.teams = await this.$axios.get_auth_data('v1/teamsx') this.employees = await this.$axios.get_auth_data('v1/employees') // this.masterTask = await this.$axios.get_auth_data(`v1/master-task/${this.masterTaksId}`) // this.selectedTeam = `${this.masterTask.team.name} - ${this.masterTask.team.id}`) } catch (error) { - this.$toast(error) + this.$toast.error(error) } }, diff --git a/app/src/plugins/tm@modal/sub-task/z-sub-task-modal.vue b/app/src/plugins/tm@modal/sub-task/z-sub-task-modal.vue index 8bb0ca8..e539c12 100644 --- a/app/src/plugins/tm@modal/sub-task/z-sub-task-modal.vue +++ b/app/src/plugins/tm@modal/sub-task/z-sub-task-modal.vue @@ -345,7 +345,7 @@ export default { this.masterTasks = await this.$axios.get_auth_data('v1/master-tasks') this.employees = await this.$axios.get_auth_data('v1/employees') } catch (error) { - this.$toast(error) + this.$toast.error(error) } }, @@ -382,7 +382,7 @@ export default { this.close() this.$router.push({ name: 'Dashboard - Tasks' }) } catch (error) { - this.$toast(error) + this.$toast.error(error) } }, diff --git a/app/src/plugins/tm@overview/_components/z-tasks-search.vue b/app/src/plugins/tm@overview/_components/z-tasks-search.vue index 62082c2..fbc56c8 100644 --- a/app/src/plugins/tm@overview/_components/z-tasks-search.vue +++ b/app/src/plugins/tm@overview/_components/z-tasks-search.vue @@ -33,7 +33,7 @@ export default { try { this.employees = await this.$axios.get_auth_data('v1/employees') } catch (error) { - this.$toast(error) + this.$toast.error(error) } }, diff --git a/app/src/plugins/w/axios/models/axios.ts b/app/src/plugins/w/axios/models/axios.ts index 8a68f5f..492ef97 100644 --- a/app/src/plugins/w/axios/models/axios.ts +++ b/app/src/plugins/w/axios/models/axios.ts @@ -21,7 +21,7 @@ export default { async get_data(url: string, config?: any) { return axios.get(url, config) .then(response => response.data.data) - .catch(error => Promise.reject(error.response)) + .catch(error => Promise.reject(error.response || error)) }, async get_auth_data(url: string, config?: any) { @@ -29,7 +29,7 @@ export default { return axios.get(url, config) .then(response => Promise.resolve(response.data.data)) - .catch(error => Promise.reject(error.response)) + .catch(error => Promise.reject(error.response || error)) }, async post(url: string, params = null, config?: any) { @@ -51,7 +51,7 @@ export default { return axios.post(url, params, config) .then(response => response.data.data) - .catch(error => Promise.reject(error.response)) + .catch(error => Promise.reject(error.response || error)) }, async post_auth_data(url: string, params = null, config?: any) { @@ -59,7 +59,7 @@ export default { return axios.post(url, params, config) .then(response => response.data.data) - .catch(error => Promise.reject(error.response)) + .catch(error => Promise.reject(error.response || error)) }, async delete(url: string, config?: any) { @@ -79,7 +79,7 @@ export default { async delete_data(url: string, config?: any) { return axios.delete(url, config) .then(response => response.data.data) - .catch(error => Promise.reject(error.response)) + .catch(error => Promise.reject(error.response || error)) }, async delete_auth_data(url: string, config?: any) { @@ -87,7 +87,7 @@ export default { return axios.delete(url, config) .then(response => response.data.data) - .catch(error => Promise.reject(error.response)) + .catch(error => Promise.reject(error.response || error)) }, async patch(url: string, params = null, config?: any) { @@ -107,7 +107,7 @@ export default { async patch_data(url: string, params = null, config?: any) { return axios.patch(url, params, config) .then(response => response.data.data) - .catch(error => Promise.reject(error.response)) + .catch(error => Promise.reject(error.response || error)) }, async patch_auth_data(url: string, params = null, config?: any) { @@ -115,7 +115,7 @@ export default { return axios.patch(url, params, config) .then(response => response.data.data) - .catch(error => Promise.reject(error.response)) + .catch(error => Promise.reject(error.response || error)) }, async put(url: string, params = null, config?: any) { @@ -135,7 +135,7 @@ export default { async put_data(url: string, params = null, config?: any) { return axios.put(url, params, config) .then(response => response.data.data) - .catch(error => Promise.reject(error.response)) + .catch(error => Promise.reject(error.response || error)) }, async put_auth_data(url: string, params = null, config?: any) { @@ -143,7 +143,7 @@ export default { return axios.put(url, params, config) .then(response => response.data.data) - .catch(error => Promise.reject(error.response)) + .catch(error => Promise.reject(error.response || error)) }, _config(config: any) { diff --git a/app/src/plugins/w/loadable/_components/w-loadable.vue b/app/src/plugins/w/loadable/_components/w-loadable.vue index 56956e6..3bf0f15 100644 --- a/app/src/plugins/w/loadable/_components/w-loadable.vue +++ b/app/src/plugins/w/loadable/_components/w-loadable.vue @@ -1,7 +1,7 @@ diff --git a/app/src/plugins/tm@modal/sub-task/z-add-time-task-modal.vue b/app/src/plugins/tm@modal/sub-task/z-add-time-task-modal.vue index 16e8c81..5d64860 100644 --- a/app/src/plugins/tm@modal/sub-task/z-add-time-task-modal.vue +++ b/app/src/plugins/tm@modal/sub-task/z-add-time-task-modal.vue @@ -35,18 +35,6 @@ export default { } }, - methods: { - showModal() { - this.visible = true - }, - - close() { - this.visible = false - this.$emit('close', this.blocker) - this.blocker = null - }, - }, - computed: { show: { get() { @@ -57,6 +45,18 @@ export default { if (!value) this.$emit('close') } }, + }, + + methods: { + showModal() { + this.visible = true + }, + + close() { + this.visible = false + this.$emit('close', this.blocker) + this.blocker = null + }, } } diff --git a/app/src/plugins/tm@modal/task/z-complete-task-modal.vue b/app/src/plugins/tm@modal/task/z-complete-task-modal.vue index f6438d1..ec6c1b5 100644 --- a/app/src/plugins/tm@modal/task/z-complete-task-modal.vue +++ b/app/src/plugins/tm@modal/task/z-complete-task-modal.vue @@ -34,6 +34,18 @@ export default { } }, + computed: { + show: { + get() { + return this.visible + }, + + set(value) { + if (!value) this.$emit('close') + } + }, + }, + methods: { async complete() { try { @@ -49,18 +61,6 @@ export default { this.$toast.error(error) } } - }, - - computed: { - show: { - get() { - return this.visible - }, - - set(value) { - if (!value) this.$emit('close') - } - }, } } \ No newline at end of file diff --git a/app/src/plugins/tm@modal/team/z-delete-team-modal.vue b/app/src/plugins/tm@modal/team/z-delete-team-modal.vue index 25308b3..13607f6 100644 --- a/app/src/plugins/tm@modal/team/z-delete-team-modal.vue +++ b/app/src/plugins/tm@modal/team/z-delete-team-modal.vue @@ -33,17 +33,6 @@ export default { } }, - methods: { - async deleteTeam() { - try { - await this.$axios.delete(`v1/teams/${this.team.id}`) - this.show = false - } catch (error) { - this.$toast.error(error) - } - } - }, - computed: { show: { get() { @@ -54,6 +43,17 @@ export default { if (!value) this.$emit('close') } }, + }, + + methods: { + async deleteTeam() { + try { + await this.$axios.delete(`v1/teams/${this.team.id}`) + this.show = false + } catch (error) { + this.$toast.error(error) + } + } } } \ No newline at end of file diff --git a/app/src/plugins/tm@overview/_components/z-tasks-search.vue b/app/src/plugins/tm@overview/_components/z-tasks-search.vue index 62082c2..fb8f08e 100644 --- a/app/src/plugins/tm@overview/_components/z-tasks-search.vue +++ b/app/src/plugins/tm@overview/_components/z-tasks-search.vue @@ -29,6 +29,16 @@ export default { } }, + computed: { + allEmployees() { + const employees = this.employees.map((employee) => { + return `${employee.name} ${employee.surname}` + }) + return employees + + } + }, + async created() { try { this.employees = await this.$axios.get_auth_data('v1/employees') @@ -41,16 +51,6 @@ export default { onInput() { this.$emit('queryChange', this.searchQuery) } - }, - - computed: { - allEmployees() { - const employees = this.employees.map((employee) => { - return `${employee.name} ${employee.surname}` - }) - return employees - - } } }