Commit d3a176c2 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Merge pull request #3993 from bke-drewb/3599

Issue 3599: Add snippets_enabled flag to projects for API
......@@ -53,6 +53,7 @@
"merge_requests_enabled": true,
"wall_enabled": true,
"wiki_enabled": true,
"snippets_enabled": true,
"created_at": "2012-05-30T12:49:20Z",
"last_activity_at": "2012-05-23T08:05:02Z"
}
......@@ -95,6 +96,7 @@
"merge_requests_enabled": true,
"wall_enabled": true,
"wiki_enabled": true,
"snippets_enabled": true,
"created_at": "2012-05-30T12:49:20Z",
"last_activity_at": "2012-05-23T08:05:02Z"
}
......@@ -182,10 +184,11 @@
+ `name` (required) - new project name
+ `description` (optional) - short project description
+ `default_branch` (optional) - 'master' by default
+ `issues_enabled` (optional) - enabled by default
+ `wall_enabled` (optional) - enabled by default
+ `merge_requests_enabled` (optional) - enabled by default
+ `wiki_enabled` (optional) - enabled by default
+ `issues_enabled` (optional)
+ `wall_enabled` (optional)
+ `merge_requests_enabled` (optional)
+ `wiki_enabled` (optional)
+ `snippets_enabled` (optional)
**Project access levels**
......@@ -213,10 +216,11 @@
+ `name` (required) - new project name
+ `description` (optional) - short project description
+ `default_branch` (optional) - 'master' by default
+ `issues_enabled` (optional) - enabled by default
+ `wall_enabled` (optional) - enabled by default
+ `merge_requests_enabled` (optional) - enabled by default
+ `wiki_enabled` (optional) - enabled by default
+ `issues_enabled` (optional)
+ `wall_enabled` (optional)
+ `merge_requests_enabled` (optional)
+ `wiki_enabled` (optional)
+ `snippets_enabled` (optional)
......@@ -477,4 +481,4 @@
Parameter:
+ `id` (required) - The ID of the project
\ No newline at end of file
+ `id` (required) - The ID of the project
......@@ -36,7 +36,7 @@
expose :owner, using: Entities::UserBasic
expose :name, :name_with_namespace
expose :path, :path_with_namespace
expose :issues_enabled, :merge_requests_enabled, :wall_enabled, :wiki_enabled, :created_at, :last_activity_at
expose :issues_enabled, :merge_requests_enabled, :wall_enabled, :wiki_enabled, :snippets_enabled, :created_at, :last_activity_at
expose :namespace
expose :forked_from_project, using: Entities::ForkedFromProject, :if => lambda{ | project, options | project.forked? }
end
......
......@@ -61,10 +61,11 @@
# name (required) - name for new project
# description (optional) - short project description
# default_branch (optional) - 'master' by default
# issues_enabled (optional) - enabled by default
# wall_enabled (optional) - enabled by default
# merge_requests_enabled (optional) - enabled by default
# wiki_enabled (optional) - enabled by default
# issues_enabled (optional)
# wall_enabled (optional)
# merge_requests_enabled (optional)
# wiki_enabled (optional)
# snippets_enabled (optional)
# namespace_id (optional) - defaults to user namespace
# Example Request
# POST /projects
......@@ -77,6 +78,7 @@
:wall_enabled,
:merge_requests_enabled,
:wiki_enabled,
:snippets_enabled,
:namespace_id]
@project = ::Projects::CreateContext.new(current_user, attrs).execute
if @project.saved?
......@@ -96,10 +98,11 @@
# name (required) - name for new project
# description (optional) - short project description
# default_branch (optional) - 'master' by default
# issues_enabled (optional) - enabled by default
# wall_enabled (optional) - enabled by default
# merge_requests_enabled (optional) - enabled by default
# wiki_enabled (optional) - enabled by default
# issues_enabled (optional)
# wall_enabled (optional)
# merge_requests_enabled (optional)
# wiki_enabled (optional)
# snippets_enabled (optional)
# Example Request
# POST /projects/user/:user_id
post "user/:user_id" do
......@@ -111,7 +114,8 @@
:issues_enabled,
:wall_enabled,
:merge_requests_enabled,
:wiki_enabled]
:wiki_enabled,
:snippets_enabled]
@project = ::Projects::CreateContext.new(user, attrs).execute
if @project.saved?
present @project, with: Entities::Project
......
Supports Markdown
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