Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
859858c7
Commit
859858c7
authored
Jun 23, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix spec failures
parent
efb3d5e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
lib/api/users.rb
lib/api/users.rb
+4
-4
No files found.
lib/api/users.rb
View file @
859858c7
...
@@ -236,7 +236,7 @@ module API
...
@@ -236,7 +236,7 @@ module API
user
=
User
.
find_by
(
id:
params
.
delete
(
:id
))
user
=
User
.
find_by
(
id:
params
.
delete
(
:id
))
not_found!
(
'User'
)
unless
user
not_found!
(
'User'
)
unless
user
email
=
Emails
::
CreateService
.
new
(
current_user
,
user
,
declared_params
(
include_missing:
false
)).
execute
email
=
Emails
::
CreateService
.
new
(
user
,
declared_params
(
include_missing:
false
)).
execute
if
email
.
errors
.
blank?
if
email
.
errors
.
blank?
NotificationService
.
new
.
new_email
(
email
)
NotificationService
.
new
.
new_email
(
email
)
...
@@ -276,7 +276,7 @@ module API
...
@@ -276,7 +276,7 @@ module API
email
=
user
.
emails
.
find_by
(
id:
params
[
:email_id
])
email
=
user
.
emails
.
find_by
(
id:
params
[
:email_id
])
not_found!
(
'Email'
)
unless
email
not_found!
(
'Email'
)
unless
email
Emails
::
DestroyService
.
new
(
current_user
,
user
,
email:
email
.
email
).
execute
Emails
::
DestroyService
.
new
(
user
,
email:
email
.
email
).
execute
end
end
desc
'Delete a user. Available only for admins.'
do
desc
'Delete a user. Available only for admins.'
do
...
@@ -488,7 +488,7 @@ module API
...
@@ -488,7 +488,7 @@ module API
requires
:email
,
type:
String
,
desc:
'The new email'
requires
:email
,
type:
String
,
desc:
'The new email'
end
end
post
"emails"
do
post
"emails"
do
email
=
Emails
::
CreateService
.
new
(
current_user
,
current_user
,
declared_params
).
execute
email
=
Emails
::
CreateService
.
new
(
current_user
,
declared_params
).
execute
if
email
.
errors
.
blank?
if
email
.
errors
.
blank?
NotificationService
.
new
.
new_email
(
email
)
NotificationService
.
new
.
new_email
(
email
)
...
@@ -506,7 +506,7 @@ module API
...
@@ -506,7 +506,7 @@ module API
email
=
current_user
.
emails
.
find_by
(
id:
params
[
:email_id
])
email
=
current_user
.
emails
.
find_by
(
id:
params
[
:email_id
])
not_found!
(
'Email'
)
unless
email
not_found!
(
'Email'
)
unless
email
Emails
::
DestroyService
.
new
(
current_user
,
current_user
,
email:
email
.
email
).
execute
Emails
::
DestroyService
.
new
(
current_user
,
email:
email
.
email
).
execute
end
end
desc
'Get a list of user activities'
desc
'Get a list of user activities'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment