summaryrefslogtreecommitdiff
path: root/lib/api/projects.rb
diff options
context:
space:
mode:
authorJacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home>2016-01-11 18:06:15 -0500
committerJacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home>2016-01-11 18:06:15 -0500
commitf2edb26a1e4b2587f6177af2232997bc2c6a902e (patch)
tree73af4940c9f49e125c0a4a375929c31f7b240f6a /lib/api/projects.rb
parentab9612df8dd97d83a94a8290f1530760e5cc7d2e (diff)
parentf2fab27a562dbb0e1522e388b5719d226ce66e4b (diff)
downloadgitlab-ce-f2edb26a1e4b2587f6177af2232997bc2c6a902e.tar.gz
fixes conflicts
Diffstat (limited to 'lib/api/projects.rb')
-rw-r--r--lib/api/projects.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index a9e0960872a..8b1390e3289 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -3,7 +3,7 @@ module API
class Projects < Grape::API
before { authenticate! }
- resource :projects do
+ resource :projects, requirements: { id: /[^\/]+/ } do
helpers do
def map_public_to_visibility_level(attrs)
publik = attrs.delete(:public)
@@ -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: