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:
authorDouwe Maan <douwe@gitlab.com>2016-01-07 15:37:14 +0300
committerDouwe Maan <douwe@gitlab.com>2016-01-07 15:37:14 +0300
commit1886d727f738895bb552151d59d4024f405522e2 (patch)
tree684b1abde7d7951456a8bb0956867a953971f5eb /lib/api/projects.rb
parent09216e8bbdd82e46705888aba13405a2fd191100 (diff)
Add API project upload endpoint
Diffstat (limited to 'lib/api/projects.rb')
-rw-r--r--lib/api/projects.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index 0781236cf6d..8b1390e3289 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -269,7 +269,7 @@ module API
# Remove a forked_from relationship
#
# Parameters:
- # id: (required) - The ID of the project being marked as a fork
+ # id: (required) - The ID of the project being marked as a fork
# Example Request:
# DELETE /projects/:id/fork
delete ":id/fork" do
@@ -278,6 +278,16 @@ module API
user_project.forked_project_link.destroy
end
end
+
+ # Upload a file
+ #
+ # Parameters:
+ # id: (required) - The ID of the project
+ # file: (required) - The file to be uploaded
+ post ":id/uploads" do
+ ::Projects::UploadService.new(user_project, params[:file]).execute
+ end
+
# search for projects current_user has access to
#
# Parameters: