Commit 7040a42c authored by Nihad Abbasov's avatar Nihad Abbasov

API: ability to set an import url when creating project for a specified user

parent f7cf0286
...@@ -78,6 +78,7 @@ module API ...@@ -78,6 +78,7 @@ module API
# namespace_id (optional) - defaults to user namespace # namespace_id (optional) - defaults to user namespace
# public (optional) - if true same as setting visibility_level = 20 # public (optional) - if true same as setting visibility_level = 20
# visibility_level (optional) - 0 by default # visibility_level (optional) - 0 by default
# import_url (optional)
# Example Request # Example Request
# POST /projects # POST /projects
post do post do
...@@ -120,6 +121,7 @@ module API ...@@ -120,6 +121,7 @@ module API
# snippets_enabled (optional) # snippets_enabled (optional)
# public (optional) - if true same as setting visibility_level = 20 # public (optional) - if true same as setting visibility_level = 20
# visibility_level (optional) # visibility_level (optional)
# import_url (optional)
# Example Request # Example Request
# POST /projects/user/:user_id # POST /projects/user/:user_id
post "user/:user_id" do post "user/:user_id" do
...@@ -134,7 +136,8 @@ module API ...@@ -134,7 +136,8 @@ module API
:wiki_enabled, :wiki_enabled,
:snippets_enabled, :snippets_enabled,
:public, :public,
:visibility_level] :visibility_level,
:import_url]
attrs = map_public_to_visibility_level(attrs) attrs = map_public_to_visibility_level(attrs)
@project = ::Projects::CreateService.new(user, attrs).execute @project = ::Projects::CreateService.new(user, attrs).execute
if @project.saved? if @project.saved?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment