Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
m4lab_tv1
User Account
Commits
1ea9adf8
Commit
1ea9adf8
authored
Apr 30, 2021
by
Rosanny Sihombing
Browse files
add deleteProjectById function
parent
cee2980f
Changes
1
Hide whitespace changes
Inline
Side-by-side
routes/gitlab.js
View file @
1ea9adf8
...
...
@@ -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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment