From fcc438e5feb9ec5a41c636cebd397744ee3ec8cc Mon Sep 17 00:00:00 2001 From: Vadim Date: Tue, 6 Oct 2026 18:11:20 +0300 Subject: [PATCH] home page --- src/api/issue.api.ts | 4 ++-- src/components/IssueCreate.vue | 12 +++++++----- src/components/IssueFilter.vue | 6 ++++-- src/stores/issue.ts | 2 +- src/views/HomeView.vue | 31 +++++++++++++++++++++---------- 5 files changed, 35 insertions(+), 20 deletions(-) diff --git a/src/api/issue.api.ts b/src/api/issue.api.ts index 0994b71..d885b6a 100644 --- a/src/api/issue.api.ts +++ b/src/api/issue.api.ts @@ -53,7 +53,7 @@ export async function itemsList(params: { page: number limit: number text?: string | null - status?: string | null + status?: string | string[] | null assigneeId?: string | null projectId?: string | null }) { @@ -63,7 +63,7 @@ export async function itemsList(params: { projectId: params.projectId, text: params.text, assigneeId: params.assigneeId, - status: params.status, + status: Array.isArray(params.status) ? params.status.join(',') : params.status, }) return apiClient.get<{ list: Issue[]; meta: Meta }>(`/api/issues/list${query}`) } diff --git a/src/components/IssueCreate.vue b/src/components/IssueCreate.vue index 5798c4b..99f0f90 100644 --- a/src/components/IssueCreate.vue +++ b/src/components/IssueCreate.vue @@ -3,9 +3,12 @@ import { reactive, ref } from 'vue' import { useIssueStore } from '@/stores/issue.ts' import { useProjectStore } from '@/stores/project.ts' import type { Issue } from '@/api/issue.api.ts' +import { storeToRefs } from 'pinia' const issueStore = useIssueStore() const projectStore = useProjectStore() +const { current } = storeToRefs(projectStore) + const emit = defineEmits<{ created: [issue: Issue] }>() const showForm = ref(false) @@ -15,10 +18,9 @@ const newIssue = reactive({ }) const onCreate = async () => { - const project = projectStore.current - if (!project) return + if (!current.value) return - const created = await issueStore.create({ ...newIssue, projectId: project.id, key: project.key }) + const created = await issueStore.create({ ...newIssue, projectId: current.value.id, key: current.value.key }) if (!created) return emit('created', created) @@ -29,7 +31,7 @@ const onCreate = async () => {