From 4740a4b4f74aaf794044c710748b09e0d3e935ae Mon Sep 17 00:00:00 2001 From: Admin Date: Mon, 17 Mar 2025 14:22:37 -0700 Subject: [PATCH] Fix createNote function to not duplicate /api/v4 in URL --- build/index.js | 3 +++ index.ts | 3 +++ 2 files changed, 6 insertions(+) diff --git a/build/index.js b/build/index.js index 817219f..42b619a 100755 --- a/build/index.js +++ b/build/index.js @@ -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}`); diff --git a/index.ts b/index.ts index 37ffeb1..1f22471 100644 --- a/index.ts +++ b/index.ts @@ -582,12 +582,15 @@ async function createNote( body: string ): Promise { // ⚙️ 응답 타입은 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}`);