From 511d2d9c0669272385f617ecce2febfa81063d87 Mon Sep 17 00:00:00 2001 From: Iwaki Takuma <39580206+iwakitakuma33@users.noreply.github.com> Date: Wed, 4 Jun 2025 21:37:14 +0900 Subject: [PATCH] FIX: bug get issues (#83) --- index.ts | 16 ++++++++++------ schemas.ts | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/index.ts b/index.ts index bdbe5f1..f5f3da5 100644 --- a/index.ts +++ b/index.ts @@ -907,13 +907,17 @@ async function listIssues( // Add all query parameters Object.entries(options).forEach(([key, value]) => { if (value !== undefined) { - if (key === "labels" && Array.isArray(value)) { - // Handle array of labels - value.forEach(label => { - url.searchParams.append("labels[]", label.toString()); - }); + if (key === "labels" ) { + if (Array.isArray(value)) { + // Handle array of labels + value.forEach(label => { + url.searchParams.append("labels[]", label.toString()); + }); + } else { + url.searchParams.append("labels[]", value.toString()); + } } else { - url.searchParams.append("labels[]", value.toString()); + url.searchParams.append(key, value.toString()); } } }); diff --git a/schemas.ts b/schemas.ts index d435ca8..3fdd801 100644 --- a/schemas.ts +++ b/schemas.ts @@ -916,7 +916,7 @@ export const CreateNoteSchema = z.object({ export const ListIssuesSchema = z.object({ project_id: z.string().describe("Project ID or URL-encoded path"), assignee_id: z.number().optional().describe("Return issues assigned to the given user ID"), - assignee_username: z.string().optional().describe("Return issues assigned to the given username"), + assignee_username: z.array(z.string()).optional().describe("Return issues assigned to the given username"), author_id: z.number().optional().describe("Return issues created by the given user ID"), author_username: z.string().optional().describe("Return issues created by the given username"), confidential: z.boolean().optional().describe("Filter confidential or public issues"),