diff --git a/frontend/src/api/snippets.ts b/frontend/src/api/snippets.ts index 40796f3..f625973 100644 --- a/frontend/src/api/snippets.ts +++ b/frontend/src/api/snippets.ts @@ -36,6 +36,7 @@ export interface Snippet { created_at: string; updated_at: string; snippet: SnippetFields; + systems?: { id: number; name: string }[]; } /** Lightweight list item from the knowledge preview feed. Note: the `snippet` @@ -63,14 +64,18 @@ export interface SnippetInput { locations?: SnippetLocation[]; tags?: string[]; project_id?: number | null; + system_ids?: number[]; + /** Create only: record it even though a near-duplicate already exists. */ + force?: boolean; } export async function listSnippets( - params: { q?: string; tag?: string } = {}, + params: { q?: string; tag?: string; projectId?: number | null } = {}, ): Promise<{ snippets: SnippetListItem[]; total: number }> { const qs = new URLSearchParams(); if (params.q) qs.set("q", params.q); if (params.tag) qs.set("tag", params.tag); + if (params.projectId) qs.set("project_id", String(params.projectId)); const query = qs.toString(); return apiGet(`/api/snippets${query ? `?${query}` : ""}`); } diff --git a/frontend/src/views/SnippetEditorView.vue b/frontend/src/views/SnippetEditorView.vue index 2b0f5af..7420b6d 100644 --- a/frontend/src/views/SnippetEditorView.vue +++ b/frontend/src/views/SnippetEditorView.vue @@ -1,5 +1,5 @@