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
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <zegerjan@gitlab.com>2016-03-24 00:36:35 +0300
committerZeger-Jan van de Weg <zegerjan@gitlab.com>2016-03-24 00:36:35 +0300
commit2c5bcf2e1b5b5574238555657296a8831b989d1e (patch)
tree38dd38d775bed175c9a165bf948c6b1d319b406d /lib/api/projects.rb
parent4798b927ab76583024c67beb43e2fa0e3ffdbf44 (diff)
Add endpoints for archiving and unarchiving
Diffstat (limited to 'lib/api/projects.rb')
-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..aa60a39f341 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
+ put ':id/archive' do
+ authorize!(:archive_project, user_project)
+
+ user_project.archive!
+
+ present @project, with: Entities::Project
+ end
+
+ # Unarchive project
+ #
+ # Parameters:
+ # id (required) - The ID of a project
+ # Example Request:
+ # PUT /projects/:id/unarchive
+ put ':id/unarchive' do
+ authorize!(:archive_project, user_project)
+
+ user_project.unarchive!
+
+ present @project, with: Entities::Project
+ end
+
# Remove project
#
# Parameters: