Skip to content
GitLab
Explore
Projects
Groups
Snippets
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
3 years ago
by
Rosanny Sihombing
Browse files
Options
Download
Email Patches
Plain Diff
add deleteProjectById function
parent
cee2980f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
routes/gitlab.js
+18
-1
routes/gitlab.js
with
18 additions
and
1 deletion
+18
-1
routes/gitlab.js
+
18
-
1
View file @
1ea9adf8
...
@@ -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
)
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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
Menu
Explore
Projects
Groups
Snippets