Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
44d8d11b4a | |||
622c112f7f |
9
index.ts
9
index.ts
@ -907,14 +907,15 @@ 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" ) {
|
const keys = ["labels", "assignee_username"];
|
||||||
|
if ( keys.includes(key)) {
|
||||||
if (Array.isArray(value)) {
|
if (Array.isArray(value)) {
|
||||||
// Handle array of labels
|
// Handle array of labels
|
||||||
value.forEach(label => {
|
value.forEach(label => {
|
||||||
url.searchParams.append("labels[]", label.toString());
|
url.searchParams.append(`${key}[]`, label.toString());
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
url.searchParams.append("labels[]", value.toString());
|
url.searchParams.append(`${key}[]`, value.toString());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
url.searchParams.append(key, value.toString());
|
url.searchParams.append(key, value.toString());
|
||||||
@ -1199,6 +1200,8 @@ async function createMergeRequest(
|
|||||||
labels: options.labels?.join(","),
|
labels: options.labels?.join(","),
|
||||||
allow_collaboration: options.allow_collaboration,
|
allow_collaboration: options.allow_collaboration,
|
||||||
draft: options.draft,
|
draft: options.draft,
|
||||||
|
remove_source_branch: options.remove_source_branch,
|
||||||
|
squash: options.squash,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -467,6 +467,8 @@ export const CreateMergeRequestOptionsSchema = z.object({
|
|||||||
labels: z.array(z.string()).optional(),
|
labels: z.array(z.string()).optional(),
|
||||||
allow_collaboration: z.boolean().optional(), // Changed from maintainer_can_modify to match GitLab API
|
allow_collaboration: z.boolean().optional(), // Changed from maintainer_can_modify to match GitLab API
|
||||||
draft: z.boolean().optional(),
|
draft: z.boolean().optional(),
|
||||||
|
remove_source_branch: z.boolean().optional().describe("Flag indicating if a merge request should remove the source branch when merging."),
|
||||||
|
squash: z.boolean().optional().describe("If true, squash all commits into a single commit on merge.")
|
||||||
});
|
});
|
||||||
|
|
||||||
export const GitLabDiffSchema = z.object({
|
export const GitLabDiffSchema = z.object({
|
||||||
|
Reference in New Issue
Block a user