summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-02-13 16:08:26 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-02-13 16:08:26 +0200
commitf0f88390c1309b0d5a8cead701477e21c2174f05 (patch)
treec1cd8d171c4dc4eb4270aca4c8feb22d863a4bbd /lib/api
parent1d48904ac807c6d382c8965329085b321381cc3d (diff)
downloadgitlab-ce-f0f88390c1309b0d5a8cead701477e21c2174f05.tar.gz
project_user selectbox with ajax autocomplete
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/projects.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index 888aa7e77d2..bcca69ff49a 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -11,7 +11,7 @@ module API
end
not_found!
end
-
+
def map_public_to_visibility_level(attrs)
publik = attrs.delete(:public)
publik = [ true, 1, '1', 't', 'T', 'true', 'TRUE', 'on', 'ON' ].include?(publik)
@@ -308,6 +308,18 @@ module API
projects = Project.where("(id in (?) OR visibility_level in (?)) AND (name LIKE (?))", ids, visibility_levels, "%#{params[:query]}%")
present paginate(projects), with: Entities::Project
end
+
+
+ # Get a users list
+ #
+ # Example Request:
+ # GET /users
+ get ':id/users' do
+ @users = User.where(id: user_project.team.users.map(&:id))
+ @users = @users.search(params[:search]) if params[:search].present?
+ @users = paginate @users
+ present @users, with: Entities::User
+ end
end
end
end