Call populate_match_below when a match is finished

This commit is contained in:
Daniel Schädler 2019-05-10 11:44:11 +02:00
parent 8fd09e3eca
commit e04d3c1c2e
1 changed files with 1 additions and 3 deletions

View File

@ -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