17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'app/controllers/concerns/account/onboarding/invitation_lists/controller_base.rb', line 17
def create
@account_onboarding_invitation_list = Account::Onboarding::InvitationList.new(account_onboarding_invitation_list_params)
@account_onboarding_invitation_list.team = current_team
@account_onboarding_invitation_list.invitations.each_with_index do |invitation, idx|
invitation.team = current_team
invitation.from_membership = current_membership
invitation.membership.team = current_team
invitation.membership.user_email = invitation.email
end
respond_to do |format|
if @account_onboarding_invitation_list.save
format.html { redirect_to account_team_path(@user.teams.first), notice: "" }
format.json { render :show, status: :ok, location: [:account, @user] }
else
format.html { render :new, status: :unprocessable_entity }
format.json { render json: @account_onboarding_invitation_list.errors, status: :unprocessable_entity }
end
end
end
|