summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-01-08 20:29:43 +0000
committerRobert Speicher <robert@gitlab.com>2016-01-08 20:29:43 +0000
commitaf68897acda31a55093e2b5fdd7eba61e54b404c (patch)
treede423ec8ff971b5f2c42cb6810259d2fab82da67 /lib/api
parent6467448a1aaaa216560d35f2bd0ac4f8932f77ec (diff)
parent0614793b38db4711053cbcb4fa80d9c8cc492eec (diff)
downloadgitlab-ce-af68897acda31a55093e2b5fdd7eba61e54b404c.tar.gz
Merge branch 'api-project-upload' into 'master'
Add API project upload endpoint Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/4317 See merge request !2329
Diffstat (limited to 'lib/api')
-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: