From 4d201b2f35b7837fb9195c3a28ee57947b200adf Mon Sep 17 00:00:00 2001 From: khansadaoudi Date: Wed, 23 Oct 2024 16:00:58 +0200 Subject: [PATCH] change popular projects logic --- src/api/backend-api.ts | 3 +++ src/pages/Index.vue | 2 +- src/pinia/modules/stats/index.ts | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/api/backend-api.ts b/src/api/backend-api.ts index db3f553f..1498718e 100644 --- a/src/api/backend-api.ts +++ b/src/api/backend-api.ts @@ -68,6 +68,9 @@ export default { getMismatchProjects() { return API.get('projects/mismatch-projects'); }, + getPopularProjects() { + return API.get('projects/popular-projects'); + }, createProject(data: createProject_ED) { return API.post('projects/', data); }, diff --git a/src/pages/Index.vue b/src/pages/Index.vue index 865d7f16..c805ebc2 100644 --- a/src/pages/Index.vue +++ b/src/pages/Index.vue @@ -314,7 +314,7 @@ export default defineComponent({ }, getPopularProjects() { api - .getProjects() + .getPopularProjects() .then((response) => { response.data.sort((a, b) => b.users.length - a.users.length); this.popularProjects = response.data.slice(0, 6); diff --git a/src/pinia/modules/stats/index.ts b/src/pinia/modules/stats/index.ts index a84e3a4a..cf932a1c 100644 --- a/src/pinia/modules/stats/index.ts +++ b/src/pinia/modules/stats/index.ts @@ -1,5 +1,4 @@ import { defineStore } from "pinia"; -import { useProjectStore } from "../project"; import { statProject_t } from "src/api/backend-types"; import { notifyError } from "src/utils/notify";