mirror of
https://github.com/jdalrymple/gitbeaker.git
synced 2026-01-25 16:04:01 +00:00
feat: Adding fork relationship support
Implemented https://docs.gitlab.com/ce/api/projects.html#fork-relationship. ForkedFromId can be supplied as a optional argument. closes: #410
This commit is contained in:
parent
d9207f374e
commit
76cb783967
@ -37,10 +37,13 @@ class Projects extends BaseService {
|
||||
return RequestHelper.get(this, `projects/${pId}/events`, options);
|
||||
}
|
||||
|
||||
fork(projectId: ProjectId, options?: BaseRequestOptions) {
|
||||
fork(projectId: ProjectId, { forkedFromId, ...options }: { forkedFromId?: number } & BaseRequestOptions = {}) {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
let url = `projects/${pId}/fork`;
|
||||
|
||||
return RequestHelper.post(this, `projects/${pId}/fork`, options);
|
||||
if (forkedFromId) url += `/${encodeURIComponent(forkedFromId)}`;
|
||||
|
||||
return RequestHelper.post(this, url, options);
|
||||
}
|
||||
|
||||
forks(projectId: ProjectId, options?: BaseRequestOptions) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user