Fix: Use plural resource names in createNote URL construction
- Changed to s to use the correct plural form in API endpoints - This fixes 404 errors when trying to add notes to issues or merge requests - Added a test file to verify the fix - Conforms to GitLab API documentation which uses plural resource names (issues, merge_requests)
This commit is contained in:
2
index.ts
2
index.ts
@ -585,7 +585,7 @@ async function createNote(
|
||||
const url = new URL(
|
||||
`${GITLAB_API_URL}/api/v4/projects/${encodeURIComponent(
|
||||
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(), {
|
||||
|
Reference in New Issue
Block a user