Commit 85a6cf47 authored by James Lopez's avatar James Lopez

fix spec failures

parent bf82b588
......@@ -242,7 +242,7 @@ module API
user = User.find_by(id: params.delete(:id))
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?
NotificationService.new.new_email(email)
......@@ -282,7 +282,7 @@ module API
email = user.emails.find_by(id: params[:email_id])
not_found!('Email') unless email
Emails::DestroyService.new(current_user, user, email: email.email).execute
Emails::DestroyService.new(user, email: email.email).execute
end
desc 'Delete a user. Available only for admins.' do
......@@ -494,7 +494,7 @@ module API
requires :email, type: String, desc: 'The new email'
end
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?
NotificationService.new.new_email(email)
......@@ -512,7 +512,7 @@ module API
email = current_user.emails.find_by(id: params[:email_id])
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
desc 'Get a list of user activities'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment