From 67d30a6f3228bdfed5a04c1bbd7c818405ab19f8 Mon Sep 17 00:00:00 2001 From: Vadim Date: Mon, 28 Sep 2026 17:44:39 +0300 Subject: [PATCH] filter --- src/App.vue | 8 ++++++-- src/api/issue.api.ts | 5 +++-- src/stores/issue.ts | 4 ++-- src/views/Issues/IssuesListView.vue | 6 +++++- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/App.vue b/src/App.vue index 4410fb5..e50620f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,13 +1,17 @@ diff --git a/src/api/issue.api.ts b/src/api/issue.api.ts index b18d895..5749f9e 100644 --- a/src/api/issue.api.ts +++ b/src/api/issue.api.ts @@ -84,6 +84,7 @@ export async function itemDelete(id: number) { return true } -export async function itemStat() { - return apiClient.get('/api/issues/stats') +export async function itemStat(projectId?: string) { + const query = toQuery({ projectId: projectId }) + return apiClient.get(`/api/issues/stats${query}`) } diff --git a/src/stores/issue.ts b/src/stores/issue.ts index d39bf80..33af822 100644 --- a/src/stores/issue.ts +++ b/src/stores/issue.ts @@ -75,9 +75,9 @@ export const useIssueStore = defineStore('item', () => { } } - async function getStat(): Promise { + async function getStat(projectId?: string | null): Promise { try { - stats.value = await itemStat() + stats.value = await itemStat(projectId ?? undefined) return stats.value } catch (e) { diff --git a/src/views/Issues/IssuesListView.vue b/src/views/Issues/IssuesListView.vue index 8cf242f..8ca24cb 100644 --- a/src/views/Issues/IssuesListView.vue +++ b/src/views/Issues/IssuesListView.vue @@ -83,9 +83,13 @@ watch(currentProjectId, async () => { clearBatch() close() await load() + await issueStore.getStat(currentProjectId.value) }) -onMounted(async () => await load()) +onMounted(async () => { + await load() + await issueStore.getStat(currentProjectId.value) +}) const gridTemplate = computed(() => (selected.value.length ? '1fr 1fr' : '1fr')) const goToIssue = (key: string[]) => router.push(`/issues/${key[0]}`)