Skip to content

Commit a7858bd

Browse files
committed
feat: Updating Project Snippets API #138
1 parent 11dbeff commit a7858bd

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

src/services/ProjectSnippets.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,19 @@ class ProjectSnippets extends BaseService {
3131
});
3232
}
3333

34-
edit(projectId, options) {
35-
const pId = encodeURIComponent(projectId);
34+
edit(projectId, snippetId, options) {
35+
const [pId, sId] = [projectId, snippetId].map(encodeURIComponent);
3636

37-
return RequestHelper.put(this, `projects/${pId}/snippets`, options);
37+
return RequestHelper.put(this, `projects/${pId}/snippets/${sId}`, options);
3838
}
3939

40-
remove(projectId) {
41-
const pId = encodeURIComponent(projectId);
40+
remove(projectId, snippetId) {
41+
const [pId, sId] = [projectId, snippetId].map(encodeURIComponent);
4242

43-
return RequestHelper.delete(this, `projects/${pId}/snippets`);
43+
return RequestHelper.delete(this, `projects/${pId}/snippets/${sId}`);
4444
}
4545

46+
4647
show(projectId, snippetId) {
4748
const [pId, sId] = [projectId, snippetId].map(encodeURIComponent);
4849

0 commit comments

Comments
 (0)