mirror of
https://github.com/jdalrymple/gitbeaker.git
synced 2026-01-25 16:04:01 +00:00
Addressing PR comments.
This commit is contained in:
parent
1f93315724
commit
1289c2bac0
@ -148,6 +148,7 @@ GroupMembers
|
||||
GroupMilestones
|
||||
GroupProjects
|
||||
GroupVariables
|
||||
GroupLabels
|
||||
Epics
|
||||
EpicIssues
|
||||
EpicNotes
|
||||
@ -302,6 +303,7 @@ GroupMembers
|
||||
GroupMilestones
|
||||
GroupProjects
|
||||
GroupVariables
|
||||
GroupLabels
|
||||
Epics
|
||||
EpicIssues
|
||||
EpicNotes
|
||||
|
||||
@ -20,6 +20,7 @@ export const GroupsBundle = bundler({
|
||||
GroupMilestones: APIServices.GroupMilestones,
|
||||
GroupProjects: APIServices.GroupProjects,
|
||||
GroupVariables: APIServices.GroupVariables,
|
||||
GroupLabels: APIServices.GroupLabels,
|
||||
Epics: APIServices.Epics,
|
||||
EpicIssues: APIServices.EpicIssues,
|
||||
EpicNotes: APIServices.EpicNotes,
|
||||
|
||||
12
src/core/services/GroupLabels.ts
Normal file
12
src/core/services/GroupLabels.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import { BaseService, PaginatedRequestOptions, RequestHelper } from '../infrastructure';
|
||||
import { GroupProjectId } from './index';
|
||||
|
||||
class GroupLabels extends BaseService {
|
||||
all(groupId: GroupProjectId, options?: PaginatedRequestOptions) {
|
||||
const gId = encodeURIComponent(groupId);
|
||||
|
||||
return RequestHelper.get(this, `groups/${gId}/labels`, options);
|
||||
}
|
||||
}
|
||||
|
||||
export default GroupLabels;
|
||||
@ -5,24 +5,13 @@ import {
|
||||
RequestHelper,
|
||||
Sudo,
|
||||
} from '../infrastructure';
|
||||
import { GroupId, ProjectId, LabelId } from '.';
|
||||
import { ProjectId, LabelId } from '.';
|
||||
|
||||
class Labels extends BaseService {
|
||||
all({
|
||||
projectId,
|
||||
groupId,
|
||||
...options
|
||||
}: ({ projectId: ProjectId } | { groupId: GroupId } | {}) & PaginatedRequestOptions) {
|
||||
let url;
|
||||
|
||||
if (projectId) {
|
||||
url = `projects/${encodeURIComponent(projectId)}/labels`;
|
||||
}
|
||||
else if (groupId) {
|
||||
url = `groups/${encodeURIComponent(groupId)}/labels`;
|
||||
}
|
||||
all(projectId: ProjectId, options?: PaginatedRequestOptions) {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
return RequestHelper.get(this, url, options);
|
||||
return RequestHelper.get(this, `projects/${pId}/labels`, options);
|
||||
}
|
||||
|
||||
create(projectId: ProjectId, labelName: string, color: string, options?: BaseRequestOptions) {
|
||||
|
||||
@ -8,6 +8,7 @@ export { default as GroupMembers } from './GroupMembers';
|
||||
export { default as GroupMilestones } from './GroupMilestones';
|
||||
export { default as GroupProjects } from './GroupProjects';
|
||||
export { default as GroupVariables } from './GroupVariables';
|
||||
export { default as GroupLabels } from './GroupLabels';
|
||||
export { default as Epics } from './Epics';
|
||||
export { default as EpicIssues } from './EpicIssues';
|
||||
export { default as EpicNotes } from './EpicNotes';
|
||||
|
||||
@ -13,6 +13,7 @@ test('All the correct service keys are included in the groups bundle', async ()
|
||||
'GroupMilestones',
|
||||
'GroupProjects',
|
||||
'GroupVariables',
|
||||
'GroupLabels',
|
||||
'Epics',
|
||||
'EpicIssues',
|
||||
'EpicNotes',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user