mirror of
https://github.com/jdalrymple/gitbeaker.git
synced 2026-01-25 16:04:01 +00:00
Updating Tag.create function to match latest API
This commit is contained in:
parent
a365c64014
commit
561f2abf99
@ -27,12 +27,14 @@ export class Tags<C extends boolean = false> extends BaseResource<C> {
|
||||
);
|
||||
}
|
||||
|
||||
create(projectId: string | number, options?: BaseRequestOptions) {
|
||||
return RequestHelper.post<TagSchema>()(
|
||||
this,
|
||||
endpoint`projects/${projectId}/repository/tags`,
|
||||
options,
|
||||
);
|
||||
create(projectId: string | number, tagName: string, ref: string, options?: BaseRequestOptions) {
|
||||
return RequestHelper.post<TagSchema>()(this, endpoint`projects/${projectId}/repository/tags`, {
|
||||
query: {
|
||||
tagName,
|
||||
ref,
|
||||
},
|
||||
...options,
|
||||
});
|
||||
}
|
||||
|
||||
remove(projectId: string | number, tagName: string, options?: Sudo) {
|
||||
|
||||
@ -40,10 +40,14 @@ describe('Tags.all', () => {
|
||||
|
||||
describe('Tags.create', () => {
|
||||
it('should request POST /projects/:id/repository/tags', async () => {
|
||||
await service.create(1, { test: 1 });
|
||||
await service.create(1, 'test', 'main', { test: 1 });
|
||||
|
||||
expect(RequestHelper.post()).toHaveBeenCalledWith(service, 'projects/1/repository/tags', {
|
||||
test: 1,
|
||||
query: {
|
||||
ref: 'main',
|
||||
tagName: 'test',
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user