Commit 6579de0727b37535ecba3a8f6188f51a714e3a3e
Exists in
spb-stable
and in
3 other branches
Merge pull request #5799 from criteo/import_url_api
Add import_url param in API projects create
Showing
2 changed files
with
3 additions
and
1 deletions
Show diff stats
doc/api/projects.md
| @@ -239,6 +239,7 @@ Parameters: | @@ -239,6 +239,7 @@ Parameters: | ||
| 239 | + `snippets_enabled` (optional) | 239 | + `snippets_enabled` (optional) |
| 240 | + `public` (optional) - if `true` same as setting visibility_level = 20 | 240 | + `public` (optional) - if `true` same as setting visibility_level = 20 |
| 241 | + `visibility_level` (optional) | 241 | + `visibility_level` (optional) |
| 242 | +* `import_url` (optional) | ||
| 242 | 243 | ||
| 243 | 244 | ||
| 244 | ### Create project for user | 245 | ### Create project for user |
lib/api/projects.rb
| @@ -99,7 +99,8 @@ module API | @@ -99,7 +99,8 @@ module API | ||
| 99 | :snippets_enabled, | 99 | :snippets_enabled, |
| 100 | :namespace_id, | 100 | :namespace_id, |
| 101 | :public, | 101 | :public, |
| 102 | - :visibility_level] | 102 | + :visibility_level, |
| 103 | + :import_url] | ||
| 103 | attrs = map_public_to_visibility_level(attrs) | 104 | attrs = map_public_to_visibility_level(attrs) |
| 104 | @project = ::Projects::CreateContext.new(current_user, attrs).execute | 105 | @project = ::Projects::CreateContext.new(current_user, attrs).execute |
| 105 | if @project.saved? | 106 | if @project.saved? |