summaryrefslogtreecommitdiff
path: root/lib/api/projects.rb
diff options
context:
space:
mode:
authorRiyad Preukschas <riyad@informatik.uni-bremen.de>2012-12-23 01:03:57 +0100
committerRiyad Preukschas <riyad@informatik.uni-bremen.de>2012-12-23 01:03:57 +0100
commitdb2c15369c365340aeaf4e431e8838714b40396b (patch)
tree26ca045a337132370b67cc8f2ed4010e3087dfa5 /lib/api/projects.rb
parentb47173da6a0fea0982d009f91e2c4d042f9b5c37 (diff)
parent68c43d59f09a66cca0da1b9a50c11421d52eac9a (diff)
downloadgitlab-ce-db2c15369c365340aeaf4e431e8838714b40396b.tar.gz
Merge branch 'master' into discussions
Conflicts: app/assets/stylesheets/main.scss app/models/project.rb app/views/notes/_common_form.html.haml app/views/notes/_per_line_form.html.haml lib/gitlab/markdown.rb spec/models/note_spec.rb
Diffstat (limited to 'lib/api/projects.rb')
-rw-r--r--lib/api/projects.rb53
1 files changed, 28 insertions, 25 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index 384dbcd5473..fb01524da39 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -16,7 +16,7 @@ module Gitlab
# Get a single project
#
# Parameters:
- # id (required) - The ID or code name of a project
+ # id (required) - The ID of a project
# Example Request:
# GET /projects/:id
get ":id" do
@@ -27,8 +27,6 @@ module Gitlab
#
# Parameters:
# name (required) - name for new project
- # code (optional) - code for new project, uses project name if not set
- # path (optional) - path for new project, uses project name if not set
# description (optional) - short project description
# default_branch (optional) - 'master' by default
# issues_enabled (optional) - enabled by default
@@ -56,18 +54,23 @@ module Gitlab
# Get a project team members
#
# Parameters:
- # id (required) - The ID or code name of a project
+ # id (required) - The ID of a project
+ # query - Query string
# Example Request:
# GET /projects/:id/members
get ":id/members" do
- @members = paginate user_project.users
+ if params[:query].present?
+ @members = paginate user_project.users.where("username LIKE ?", "%#{params[:query]}%")
+ else
+ @members = paginate user_project.users
+ end
present @members, with: Entities::ProjectMember, project: user_project
end
# Get a project team members
#
# Parameters:
- # id (required) - The ID or code name of a project
+ # id (required) - The ID of a project
# user_id (required) - The ID of a user
# Example Request:
# GET /projects/:id/members/:user_id
@@ -79,7 +82,7 @@ module Gitlab
# Add a new project team member
#
# Parameters:
- # id (required) - The ID or code name of a project
+ # id (required) - The ID of a project
# user_id (required) - The ID of a user
# access_level (required) - Project access level
# Example Request:
@@ -102,7 +105,7 @@ module Gitlab
# Update project team member
#
# Parameters:
- # id (required) - The ID or code name of a project
+ # id (required) - The ID of a project
# user_id (required) - The ID of a team member
# access_level (required) - Project access level
# Example Request:
@@ -122,7 +125,7 @@ module Gitlab
# Remove a team member from project
#
# Parameters:
- # id (required) - The ID or code name of a project
+ # id (required) - The ID of a project
# user_id (required) - The ID of a team member
# Example Request:
# DELETE /projects/:id/members/:user_id
@@ -135,7 +138,7 @@ module Gitlab
# Get project hooks
#
# Parameters:
- # id (required) - The ID or code name of a project
+ # id (required) - The ID of a project
# Example Request:
# GET /projects/:id/hooks
get ":id/hooks" do
@@ -147,7 +150,7 @@ module Gitlab
# Get a project hook
#
# Parameters:
- # id (required) - The ID or code name of a project
+ # id (required) - The ID of a project
# hook_id (required) - The ID of a project hook
# Example Request:
# GET /projects/:id/hooks/:hook_id
@@ -160,7 +163,7 @@ module Gitlab
# Add hook to project
#
# Parameters:
- # id (required) - The ID or code name of a project
+ # id (required) - The ID of a project
# url (required) - The hook URL
# Example Request:
# POST /projects/:id/hooks
@@ -177,7 +180,7 @@ module Gitlab
# Update an existing project hook
#
# Parameters:
- # id (required) - The ID or code name of a project
+ # id (required) - The ID of a project
# hook_id (required) - The ID of a project hook
# url (required) - The hook URL
# Example Request:
@@ -198,7 +201,7 @@ module Gitlab
# Delete project hook
#
# Parameters:
- # id (required) - The ID or code name of a project
+ # id (required) - The ID of a project
# hook_id (required) - The ID of hook to delete
# Example Request:
# DELETE /projects/:id/hooks
@@ -211,7 +214,7 @@ module Gitlab
# Get a project repository branches
#
# Parameters:
- # id (required) - The ID or code name of a project
+ # id (required) - The ID of a project
# Example Request:
# GET /projects/:id/repository/branches
get ":id/repository/branches" do
@@ -221,7 +224,7 @@ module Gitlab
# Get a single branch
#
# Parameters:
- # id (required) - The ID or code name of a project
+ # id (required) - The ID of a project
# branch (required) - The name of the branch
# Example Request:
# GET /projects/:id/repository/branches/:branch
@@ -233,7 +236,7 @@ module Gitlab
# Get a project repository tags
#
# Parameters:
- # id (required) - The ID or code name of a project
+ # id (required) - The ID of a project
# Example Request:
# GET /projects/:id/repository/tags
get ":id/repository/tags" do
@@ -243,7 +246,7 @@ module Gitlab
# Get a project repository commits
#
# Parameters:
- # id (required) - The ID or code name of a project
+ # id (required) - The ID of a project
# ref_name (optional) - The name of a repository branch or tag
# Example Request:
# GET /projects/:id/repository/commits
@@ -261,7 +264,7 @@ module Gitlab
# Get a project snippets
#
# Parameters:
- # id (required) - The ID or code name of a project
+ # id (required) - The ID of a project
# Example Request:
# GET /projects/:id/snippets
get ":id/snippets" do
@@ -271,7 +274,7 @@ module Gitlab
# Get a project snippet
#
# Parameters:
- # id (required) - The ID or code name of a project
+ # id (required) - The ID of a project
# snippet_id (required) - The ID of a project snippet
# Example Request:
# GET /projects/:id/snippets/:snippet_id
@@ -283,7 +286,7 @@ module Gitlab
# Create a new project snippet
#
# Parameters:
- # id (required) - The ID or code name of a project
+ # id (required) - The ID of a project
# title (required) - The title of a snippet
# file_name (required) - The name of a snippet file
# lifetime (optional) - The expiration date of a snippet
@@ -309,7 +312,7 @@ module Gitlab
# Update an existing project snippet
#
# Parameters:
- # id (required) - The ID or code name of a project
+ # id (required) - The ID of a project
# snippet_id (required) - The ID of a project snippet
# title (optional) - The title of a snippet
# file_name (optional) - The name of a snippet file
@@ -335,7 +338,7 @@ module Gitlab
# Delete a project snippet
#
# Parameters:
- # id (required) - The ID or code name of a project
+ # id (required) - The ID of a project
# snippet_id (required) - The ID of a project snippet
# Example Request:
# DELETE /projects/:id/snippets/:snippet_id
@@ -349,7 +352,7 @@ module Gitlab
# Get a raw project snippet
#
# Parameters:
- # id (required) - The ID or code name of a project
+ # id (required) - The ID of a project
# snippet_id (required) - The ID of a project snippet
# Example Request:
# GET /projects/:id/snippets/:snippet_id/raw
@@ -362,7 +365,7 @@ module Gitlab
# Get a raw file contents
#
# Parameters:
- # id (required) - The ID or code name of a project
+ # id (required) - The ID of a project
# sha (required) - The commit or branch name
# filepath (required) - The path to the file to display
# Example Request: