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:
Admin
2025-03-17 13:47:20 -07:00
parent 460ab62c00
commit 1926d77c2f
2 changed files with 67 additions and 1 deletions

View File

@ -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(), {