Fix createNote function to not duplicate /api/v4 in URL
This commit is contained in:
@ -345,8 +345,11 @@ async function updateMergeRequest(projectId, mergeRequestIid, options) {
|
||||
async function createNote(projectId, noteableType, // 'issue' 또는 'merge_request' 타입 명시
|
||||
noteableIid, body) {
|
||||
// ⚙️ 응답 타입은 GitLab API 문서에 따라 조정 가능
|
||||
// Don't add /api/v4 again since it's already included in GITLAB_API_URL
|
||||
const url = new URL(`${GITLAB_API_URL}/projects/${encodeURIComponent(projectId)}/${noteableType}s/${noteableIid}/notes` // Using plural form (issues/merge_requests) as per GitLab API documentation
|
||||
);
|
||||
// Add some debug logging
|
||||
console.log(`DEBUG - createNote function called`);
|
||||
console.log(`DEBUG - createNote - URL: ${url.toString()}`);
|
||||
console.log(`DEBUG - createNote - projectId: ${projectId}, noteableType: ${noteableType}, noteableIid: ${noteableIid}`);
|
||||
console.log(`DEBUG - createNote - GITLAB_API_URL: ${GITLAB_API_URL}`);
|
||||
|
3
index.ts
3
index.ts
@ -582,12 +582,15 @@ async function createNote(
|
||||
body: string
|
||||
): Promise<any> {
|
||||
// ⚙️ 응답 타입은 GitLab API 문서에 따라 조정 가능
|
||||
// Don't add /api/v4 again since it's already included in GITLAB_API_URL
|
||||
const url = new URL(
|
||||
`${GITLAB_API_URL}/projects/${encodeURIComponent(
|
||||
projectId
|
||||
)}/${noteableType}s/${noteableIid}/notes` // Using plural form (issues/merge_requests) as per GitLab API documentation
|
||||
);
|
||||
|
||||
// Add some debug logging
|
||||
console.log(`DEBUG - createNote function called`);
|
||||
console.log(`DEBUG - createNote - URL: ${url.toString()}`);
|
||||
console.log(`DEBUG - createNote - projectId: ${projectId}, noteableType: ${noteableType}, noteableIid: ${noteableIid}`);
|
||||
console.log(`DEBUG - createNote - GITLAB_API_URL: ${GITLAB_API_URL}`);
|
||||
|
Reference in New Issue
Block a user