Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-04-03 16:19:25 +0300
committerDouwe Maan <douwe@gitlab.com>2016-04-03 16:19:25 +0300
commitdf725aec985dc68007e78ac85970663f692f55d4 (patch)
tree193e40e478fee8509c191c265b9bcb59a08f7c1d /lib
parent136267dd356a88e6db39ad1a15e858da7b3c7361 (diff)
parentb231742687cf08d8663ce34a11f1b64f1fbe4a6a (diff)
Merge branch 'add-ability-to-archive-a-project-via-api-14296' into 'master'
Add endpoints for archiving and unarchiving Closes #14296 See merge request !3372
Diffstat (limited to 'lib')
-rw-r--r--lib/api/projects.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index 6fcb5261e40..24b31005475 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -244,6 +244,34 @@ module API
end
end
+ # Archive project
+ #
+ # Parameters:
+ # id (required) - The ID of a project
+ # Example Request:
+ # PUT /projects/:id/archive
+ post ':id/archive' do
+ authorize!(:archive_project, user_project)
+
+ user_project.archive!
+
+ present user_project, with: Entities::Project
+ end
+
+ # Unarchive project
+ #
+ # Parameters:
+ # id (required) - The ID of a project
+ # Example Request:
+ # PUT /projects/:id/unarchive
+ post ':id/unarchive' do
+ authorize!(:archive_project, user_project)
+
+ user_project.unarchive!
+
+ present user_project, with: Entities::Project
+ end
+
# Remove project
#
# Parameters: