Call populate_match_below when a match is finished
This commit is contained in:
parent
8fd09e3eca
commit
e04d3c1c2e
|
|
@ -14,9 +14,7 @@ class MatchesController < ApplicationController
|
|||
def update
|
||||
new_state = match_params['state']
|
||||
if new_state == 'finished'
|
||||
# implement logic to move the winning team into the next stage
|
||||
match_params['state'] = 'finished' # or 'team2_won' or 'undecided'
|
||||
render json: {}, status: :not_implemented
|
||||
PlayoffStageService.populate_match_below(@match) unless @match.group_match?
|
||||
end
|
||||
if @match.update(match_params)
|
||||
render json: @match
|
||||
|
|
|
|||
Loading…
Reference in New Issue