diff --git a/routes/gitlab.js b/routes/gitlab.js index 9e82a8a0f064a862656c1d7551916a9088ff8728..62ff36508f80a0747538386a7838e4892c5a1706 100644 --- a/routes/gitlab.js +++ b/routes/gitlab.js @@ -66,6 +66,24 @@ var gitlab = { 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) { return axios({ method: 'get', @@ -96,7 +114,6 @@ var gitlab = { .then(res => res.data[0].status) .catch(err => console.error(err)) }, - // delete peoject: https://docs.gitlab.com/ee/api/projects.html#delete-project // // test GraphQL getGraphqlTest: function(callback) {