Skip to content

Commit

Permalink
Refactor user_invite initialization in users_controller.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
ekumachidi committed Mar 11, 2024
1 parent 2f410c2 commit 2f56034
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/controllers/schools/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ def index
end

def new
@user_invite = DFESignInAPI::UserInvite.new(user_params)
@user_invite = if user_params.present?
DFESignInAPI::UserInvite.new(user_params)
else
DFESignInAPI::UserInvite.new
end
end

def create
Expand Down
2 changes: 2 additions & 0 deletions app/services/schools/dfe_sign_in_api/user_invite.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class UserInvite < Client

def invite_user
@response ||= response
@response['success'] = @response['status'] == 'success' if @response.present?
@response
end

private
Expand Down

0 comments on commit 2f56034

Please sign in to comment.