diff --git a/console/console-src/composables/use-dashboard-stats.ts b/console/console-src/composables/use-dashboard-stats.ts new file mode 100644 index 0000000000..9da8d52563 --- /dev/null +++ b/console/console-src/composables/use-dashboard-stats.ts @@ -0,0 +1,13 @@ +import { apiClient } from "@/utils/api-client"; +import { useQuery } from "@tanstack/vue-query"; + +export function useDashboardStats() { + const { data } = useQuery({ + queryKey: ["dashboard-stats"], + queryFn: async () => { + const { data } = await apiClient.stats.getStats(); + return data; + }, + }); + return { data }; +} diff --git a/console/console-src/modules/contents/comments/widgets/CommentStatsWidget.vue b/console/console-src/modules/contents/comments/widgets/CommentStatsWidget.vue index dfffff3f50..bfe96668ab 100644 --- a/console/console-src/modules/contents/comments/widgets/CommentStatsWidget.vue +++ b/console/console-src/modules/contents/comments/widgets/CommentStatsWidget.vue @@ -1,9 +1,8 @@