mirror of
https://github.com/jdalrymple/gitbeaker.git
synced 2026-01-25 16:04:01 +00:00
refactor: SystemHooks API function header updates
No point in having extra arguments in the function header if they arent required! BREAKING CHANGE: Removed projectId from System Hooks API since it wasn't required
This commit is contained in:
parent
037f4ed1ee
commit
6ea90d32ce
@ -1,30 +1,24 @@
|
||||
import { BaseService, RequestHelper } from '../infrastructure';
|
||||
import { RequestOptions } from '../infrastructure/RequestHelper';
|
||||
|
||||
export type HookId = string | number;
|
||||
class SystemHooks extends BaseService {
|
||||
add(url: string, options: RequestOptions) {
|
||||
add(url: string, options?: BaseRequestOptions) {
|
||||
return RequestHelper.post(this, 'hooks', { url, ...options });
|
||||
}
|
||||
|
||||
all(options: RequestOptions) {
|
||||
all(options?: PaginatedRequestOptions) {
|
||||
return RequestHelper.get(this, 'hooks', options);
|
||||
}
|
||||
|
||||
edit(hookId: HookId, url: string, options: RequestOptions) {
|
||||
edit(hookId: HookId, url: string, options?: BaseRequestOptions) {
|
||||
const hId = encodeURIComponent(hookId);
|
||||
|
||||
return RequestHelper.put(this, `hooks/${hId}`, { url, ...options });
|
||||
}
|
||||
|
||||
remove(
|
||||
// @ts-ignore 'projectId' is declared but its value is never read
|
||||
projectId: ProjectId,
|
||||
hookId: HookId,
|
||||
) {
|
||||
remove(hookId: HookId, options?: Sudo) {
|
||||
const hId = encodeURIComponent(hookId);
|
||||
|
||||
return RequestHelper.delete(this, `hooks/${hId}`);
|
||||
return RequestHelper.del(this, `hooks/${hId}`, options);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user