Skip to content

Commit 5e7b1bd

Browse files
max-wittigjdalrymple
authored andcommitted
feat(projects): add archive/unarchive functionality (#168)
Uses this endpoint https://docs.gitlab.com/ce/api/projects.html#archive-a-project Fixes #166
1 parent 24d9bcd commit 5e7b1bd

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/services/Projects.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ class Projects extends BaseService {
88
return RequestHelper.get(this, 'projects', options);
99
}
1010

11+
archive(projectId) {
12+
const pId = encodeURIComponent(projectId);
13+
14+
return RequestHelper.post(this, `projects/${pId}/archive`);
15+
}
16+
1117
create(options) {
1218
const url = options.userId ? `projects/user/${encodeURIComponent(options.userId)}` : 'projects';
1319

@@ -93,6 +99,12 @@ class Projects extends BaseService {
9399
return RequestHelper.put(this, `projects/${pId}/transfer`, namespace);
94100
}
95101

102+
unarchive(projectId) {
103+
const pId = encodeURIComponent(projectId);
104+
105+
return RequestHelper.post(this, `projects/${pId}/unarchive`);
106+
}
107+
96108
unshare(projectId, groupId) {
97109
const [pId, gId] = [projectId, groupId].map(encodeURIComponent);
98110

0 commit comments

Comments
 (0)