jdalrymple / gitbeaker

🦊🧪 A comprehensive and typed Gitlab SDK for Node.js, Browsers, Deno and CLI
Other
1.5k stars 283 forks source link

Group Epics Resource Events giving 404 #3593

Open arsdehnel opened 1 month ago

arsdehnel commented 1 month ago

Description

Trying to use this method in my code:

await gitlab.EpicLabelEvents.all( 729, epic.id );

And if gives me a 404. I used got directly and it worked:

await got( `https://${ process.env.GITLAB_HOSTNAME }/api/v4/groups/729/epics/${ epic.id }/resource_label_events`, {
    method: 'GET',
    headers: {
        'PRIVATE-TOKEN': process.env.GITLAB_API_TOKEN,
    },
} ).json();

Looking at https://github.com/jdalrymple/gitbeaker/blob/main/packages/core/src/resources/EpicLabelEvents.ts#L31 I think the issue is that the second argument to super() should be plural. Right now it is this:

super('groups', 'epic', options);

And I think it should be

super('groups', 'epics', options);

Steps to reproduce

I didn't create a reproduction outside of my private hosted GitLab because I think it's just a typo.

Expected behaviour

That method works the same way as my got version.

Actual behaviour

Returns 404

Possible fixes

Add an s to the second argument.

Checklist

arsdehnel commented 1 month ago

I made https://github.com/jdalrymple/gitbeaker/pull/3594 that I think should address it. I didn't pull it down locally though, just made the change in the online editor.