Commit 1ea9adf8 authored by Rosanny Sihombing's avatar Rosanny Sihombing
Browse files

add deleteProjectById function

5 merge requests!143updating yml config,!91Prepare prod,!90Testing,!89Testing,!80Mlab 501
This commit is part of merge request !80. Comments created here will be created in the context of that merge request.
Showing with 18 additions and 1 deletion
+18 -1
...@@ -66,6 +66,24 @@ var gitlab = { ...@@ -66,6 +66,24 @@ var gitlab = {
data: err.response.data data: err.response.data
}) })
}, },
deleteProjectById: function(projectId){
// https://docs.gitlab.com/ee/api/projects.html#delete-project
return axios({
method: 'delete',
url: 'https://transfer.hft-stuttgart.de/gitlab/api/v4/projects/'+projectId,
headers: {
'Authorization': 'Bearer '+config.gitlab.token_readWriteProjects
}
})
.then(res => res = {
error: false,
data: res.data
})
.catch(err => res = {
error: true,
data: err.response.data
})
},
getUserProjects: async function(gitlabUserId) { getUserProjects: async function(gitlabUserId) {
return axios({ return axios({
method: 'get', method: 'get',
...@@ -96,7 +114,6 @@ var gitlab = { ...@@ -96,7 +114,6 @@ var gitlab = {
.then(res => res.data[0].status) .then(res => res.data[0].status)
.catch(err => console.error(err)) .catch(err => console.error(err))
}, },
// delete peoject: https://docs.gitlab.com/ee/api/projects.html#delete-project
// //
// test GraphQL // test GraphQL
getGraphqlTest: function(callback) { getGraphqlTest: function(callback) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment