diff options
author | Alex Denisov <1101.debian@gmail.com> | 2012-08-31 10:15:37 +0300 |
---|---|---|
committer | Alex Denisov <1101.debian@gmail.com> | 2012-08-31 10:15:37 +0300 |
commit | c1173e27071b83399cd92406b229be7f0eca59f1 (patch) | |
tree | b2c83cb701bf88f64c582dc22420aa566ad7ac08 /lib/api | |
parent | 65abd8b20ab047016e2fc30e5cd1edf5bf4554ea (diff) | |
download | gitlab-ce-c1173e27071b83399cd92406b229be7f0eca59f1.tar.gz |
API on Projects creation implemented
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/projects.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb index eb23641c605..7ac2fd4a249 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -23,6 +23,27 @@ module Gitlab present user_project, with: Entities::Project end + # Create new project + # + # Parameters: + # name (required) - name for new project + # code (optional) - code for new project, if not set used name + # path (optional) - oath for new project, if not set used name + # Example Request + # POST /projects + post do + project = {} + project[:name] = params[:name] + project[:code] = params[:code] || project[:name] + project[:path] = params[:path] || project[:name] + @project = Project.create_by_user(project, current_user) + if @project.saved? + present @project, with: Entities::Project + else + error!({'message' => '404 Not found'}, 404) + end + end + # Get a project repository branches # # Parameters: |