Fix createNote function URL construction: use plural resource names and avoid duplicate /api/v4

This fix resolves two issues in the createNote function:

1. Use plural form for resource types (issues, merge_requests) in the URL path

2. Remove duplicate /api/v4 in URL construction, which caused 404 errors

These changes align with the GitLab API documentation and fix 404 errors when adding notes to issues or merge requests.
This commit is contained in:
Admin
2025-03-17 14:38:56 -07:00
parent 460ab62c00
commit c28f36e81f

View File

@ -583,9 +583,9 @@ async function createNote(
): Promise<any> { ): Promise<any> {
// ⚙️ 응답 타입은 GitLab API 문서에 따라 조정 가능 // ⚙️ 응답 타입은 GitLab API 문서에 따라 조정 가능
const url = new URL( const url = new URL(
`${GITLAB_API_URL}/api/v4/projects/${encodeURIComponent( `${GITLAB_API_URL}/projects/${encodeURIComponent(
projectId projectId
)}/${noteableType}/${noteableIid}/notes` )}/${noteableType}s/${noteableIid}/notes` // Using plural form (issues/merge_requests) as per GitLab API documentation
); );
const response = await fetch(url.toString(), { const response = await fetch(url.toString(), {