|
|
@ -32,6 +32,6 @@ class Competitions::JoinTeamService < ApplicationService
|
|
|
|
raise Error, '该战队队员人数已满' if !is_teacher && team.members.count == competition.member_staff.maximum
|
|
|
|
raise Error, '该战队队员人数已满' if !is_teacher && team.members.count == competition.member_staff.maximum
|
|
|
|
|
|
|
|
|
|
|
|
role = is_teacher ? 3 : 2
|
|
|
|
role = is_teacher ? 3 : 2
|
|
|
|
team.team_members.create!(competition_id: competition.id, user_id: user, role: role, is_teacher: is_teacher)
|
|
|
|
team.team_members.create!(competition_id: competition.id, user_id: user.id, role: role, is_teacher: is_teacher)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|