FIX: bug get issues (#83)

This commit is contained in:
Iwaki Takuma
2025-06-04 21:37:14 +09:00
committed by GitHub
parent 8cb7703aa1
commit 511d2d9c06
2 changed files with 11 additions and 7 deletions

View File

@ -907,13 +907,17 @@ async function listIssues(
// Add all query parameters // Add all query parameters
Object.entries(options).forEach(([key, value]) => { Object.entries(options).forEach(([key, value]) => {
if (value !== undefined) { if (value !== undefined) {
if (key === "labels" && Array.isArray(value)) { if (key === "labels" ) {
// Handle array of labels if (Array.isArray(value)) {
value.forEach(label => { // Handle array of labels
url.searchParams.append("labels[]", label.toString()); value.forEach(label => {
}); url.searchParams.append("labels[]", label.toString());
});
} else {
url.searchParams.append("labels[]", value.toString());
}
} else { } else {
url.searchParams.append("labels[]", value.toString()); url.searchParams.append(key, value.toString());
} }
} }
}); });

View File

@ -916,7 +916,7 @@ export const CreateNoteSchema = z.object({
export const ListIssuesSchema = z.object({ export const ListIssuesSchema = z.object({
project_id: z.string().describe("Project ID or URL-encoded path"), 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_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_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"), author_username: z.string().optional().describe("Return issues created by the given username"),
confidential: z.boolean().optional().describe("Filter confidential or public issues"), confidential: z.boolean().optional().describe("Filter confidential or public issues"),