diff options
author | manojmj <mmj@gitlab.com> | 2019-07-16 14:52:40 +0530 |
---|---|---|
committer | manojmj <mmj@gitlab.com> | 2019-07-17 01:11:10 +0530 |
commit | ce40c12849c8977e285962f8752cd78ac64c92ea (patch) | |
tree | 5744b8cdc8ec403df08305f034ec49d0bd05e9cf /lib | |
parent | 3a55ba7de49a1e3ce54bbf7b10640d66ed5af0bc (diff) | |
download | gitlab-ce-ce40c12849c8977e285962f8752cd78ac64c92ea.tar.gz |
CE: Read and write User "Admin notes" via API
This change adds the ability to read and
write admin notes for a user via the
USER API
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/users.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/api/users.rb b/lib/api/users.rb index 41418aa216c..e145bfdc96a 100644 --- a/lib/api/users.rb +++ b/lib/api/users.rb @@ -148,7 +148,7 @@ module API end desc 'Create a user. Available only for admins.' do - success Entities::UserPublic + success Entities::UserWithAdmin end params do requires :email, type: String, desc: 'The email of the user' @@ -168,7 +168,7 @@ module API user = ::Users::CreateService.new(current_user, params).execute(skip_authorization: true) if user.persisted? - present user, with: Entities::UserPublic, current_user: current_user + present user, with: Entities::UserWithAdmin, current_user: current_user else conflict!('Email has already been taken') if User .by_any_email(user.email.downcase) @@ -183,7 +183,7 @@ module API end desc 'Update a user. Available only for admins.' do - success Entities::UserPublic + success Entities::UserWithAdmin end params do requires :id, type: Integer, desc: 'The ID of the user' @@ -215,7 +215,7 @@ module API result = ::Users::UpdateService.new(current_user, user_params.merge(user: user)).execute if result[:status] == :success - present user, with: Entities::UserPublic, current_user: current_user + present user, with: Entities::UserWithAdmin, current_user: current_user else render_validation_error!(user) end |