diff --git a/src/abstraction/repository/statisticRepository.js b/src/abstraction/repository/statisticRepository.js index c416e1b..51165ec 100644 --- a/src/abstraction/repository/statisticRepository.js +++ b/src/abstraction/repository/statisticRepository.js @@ -3,6 +3,7 @@ import url from "@/router/url" import { getJson } from "../resources/statisticResource"; export default class StatisticRepository { async indexAdmin() { + console.log('s'); let response = await axios.get(url("indexAdmin")); if (response.status === 200) { return getJson(response.data.data) diff --git a/src/components/Dashboard/Main.vue b/src/components/Dashboard/Main.vue index d814e10..0a8462b 100644 --- a/src/components/Dashboard/Main.vue +++ b/src/components/Dashboard/Main.vue @@ -204,7 +204,6 @@ import Notification from "../Global/Section/Notification.vue"; import UserName from "../Global/Section/UserName.vue"; import { UserStorage } from "@/utils/storage"; import StatisticRepository from "@/abstraction/repository/statisticRepository.js"; -import { mapMutations, mapState } from "vuex"; export default { components: { UserName, @@ -215,30 +214,19 @@ export default { type: UserStorage.get() ? UserStorage.get().type : null, statistics: {}, }), - computed: { - ...mapState("users", ["filters"]), - }, methods: { - ...mapMutations("users", ["SET_FILTER_USER"]), async loadStatistic() { let repository = new StatisticRepository(); this.statistics = - this.role === "admin" + this.type === "admin" ? await repository.indexAdmin() - : this.role === "trainer" + : this.type === "trainer" ? await repository.indexTrainer() - : this.role === "trainee" + : this.type === "trainee" ? await repository.indexTrainee() : false; }, trainersList() { - // this.SET_FILTER_USER({}); - // this.SET_FILTER_USER({ - // role_name: { - // type: "in", - // val: "trainer", - // }, - // }); this.$router.push({ name: "users", query: { @@ -247,13 +235,6 @@ export default { }); }, traineesList() { - // this.SET_FILTER_USER({}); - // this.SET_FILTER_USER({ - // role_name: { - // type: "in", - // val: "trainee", - // }, - // }); this.$router.push({ name: "users", query: { diff --git a/src/components/Global/Section/Box.vue b/src/components/Global/Section/Box.vue index 3b8f15e..72a7cec 100644 --- a/src/components/Global/Section/Box.vue +++ b/src/components/Global/Section/Box.vue @@ -1,10 +1,18 @@