diff --git a/frontend/src/api/systems.ts b/frontend/src/api/systems.ts index 5206f58..1fa194d 100644 --- a/frontend/src/api/systems.ts +++ b/frontend/src/api/systems.ts @@ -42,3 +42,23 @@ export async function updateSystem( export async function deleteSystem(projectId: number, systemId: number): Promise { return apiDelete(`/api/projects/${projectId}/systems/${systemId}`); } + +// Lightweight issue shape returned by the project-issues list endpoint. +export interface TaskLike { + id: number; + title: string; + status: string; + priority: string; + systems?: System[]; + updated_at?: string | null; +} + +export async function getProjectIssues( + projectId: number, + openOnly = true, +): Promise { + const data = await apiGet<{ issues: TaskLike[] }>( + `/api/projects/${projectId}/issues?open_only=${openOnly}`, + ); + return data.issues; +} diff --git a/frontend/src/components/SystemsSection.vue b/frontend/src/components/SystemsSection.vue index 75ce89e..46ebb2a 100644 --- a/frontend/src/components/SystemsSection.vue +++ b/frontend/src/components/SystemsSection.vue @@ -2,7 +2,8 @@ import { ref, computed, onMounted, watch } from "vue"; import { useSystemsStore } from "@/stores/systems"; import { useToastStore } from "@/stores/toast"; -import type { System } from "@/api/systems"; +import { getProjectIssues } from "@/api/systems"; +import type { System, TaskLike } from "@/api/systems"; import { Pencil, Trash2, Archive, ArchiveRestore } from "lucide-vue-next"; const props = defineProps<{ projectId: number }>(); @@ -12,6 +13,7 @@ const toast = useToastStore(); const error = ref(null); const showArchived = ref(false); +const issues = ref([]); // Create state const showCreate = ref(false); @@ -42,6 +44,11 @@ async function load() { } catch { error.value = "Failed to load systems."; } + try { + issues.value = await getProjectIssues(props.projectId); + } catch { + issues.value = []; + } } onMounted(load); @@ -138,6 +145,22 @@ async function confirmDelete() {