Skip to content

Commit

Permalink
Merge pull request #575 from tduehr/user_email_change
Browse files Browse the repository at this point in the history
add skip_confirmation param to add email
  • Loading branch information
NARKOZ authored Jul 11, 2020
2 parents 014d6da + 172ccb4 commit f2910fa
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/gitlab/client/users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,15 @@ def email(id)
#
# @param [String] email Email address
# @param [Integer] user_id The ID of a user.
# @param [Boolean] skip_confirmation Skip confirmation and assume e-mail is verified
# @return [Gitlab::ObjectifiedHash]
def add_email(email, user_id = nil)
def add_email(email, user_id = nil, skip_confirmation = nil)
url = user_id.to_i.zero? ? '/user/emails' : "/users/#{user_id}/emails"
post(url, body: { email: email })
if skip_confirmation.nil?
post(url, body: { email: email })
else
post(url, body: { email: email, skip_confirmation: skip_confirmation })
end
end

# Delete email
Expand Down

0 comments on commit f2910fa

Please sign in to comment.