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