Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DojoBackendAPI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dojo Project (HES-SO)
Projects
Backend
DojoBackendAPI
Commits
f31d3eea
Commit
f31d3eea
authored
1 year ago
by
michael.minelli
Browse files
Options
Downloads
Patches
Plain Diff
GitlabManager => Add edit repo functions
parent
b68861d9
No related branches found
No related tags found
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ExpressAPI/src/managers/GitlabManager.ts
+10
-0
10 additions, 0 deletions
ExpressAPI/src/managers/GitlabManager.ts
with
10 additions
and
0 deletions
ExpressAPI/src/managers/GitlabManager.ts
+
10
−
0
View file @
f31d3eea
...
...
@@ -72,6 +72,16 @@ class GitlabManager {
return
response
.
data
;
}
async
editRepository
(
repoId
:
number
,
newAttributes
:
Partial
<
GitlabRepository
>
):
Promise
<
GitlabRepository
>
{
const
response
=
await
axios
.
put
<
GitlabRepository
>
(
this
.
getApiUrl
(
GitlabRoutes
.
REPOSITORY_EDIT
).
replace
(
'
{{id}}
'
,
String
(
repoId
)),
newAttributes
);
return
response
.
data
;
}
async
changeRepositoryVisibility
(
repoId
:
number
,
visibility
:
GitlabVisibility
):
Promise
<
GitlabRepository
>
{
return
await
this
.
editRepository
(
repoId
,
{
visibility
:
visibility
.
toString
()
});
}
async
addRepositoryMember
(
repoId
:
number
,
userId
:
number
,
accessLevel
:
GitlabAccessLevel
):
Promise
<
GitlabMember
>
{
const
response
=
await
axios
.
post
<
GitlabMember
>
(
this
.
getApiUrl
(
GitlabRoutes
.
REPOSITORY_MEMBER_ADD
).
replace
(
'
{{id}}
'
,
String
(
repoId
)),
{
user_id
:
userId
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment