Respond with 501 for state param 'finished'
(501 = NOT IMPLEMENTED)
This commit is contained in:
parent
3876f57d32
commit
27c4bcacc8
|
|
@ -12,6 +12,12 @@ class MatchesController < ApplicationController
|
||||||
|
|
||||||
# PATCH/PUT /matches/1
|
# PATCH/PUT /matches/1
|
||||||
def update
|
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'] = 'team1_won' # or 'team2_won' or 'undecided'
|
||||||
|
render json: {}, status: :not_implemented
|
||||||
|
end
|
||||||
if @match.update(match_params)
|
if @match.update(match_params)
|
||||||
render json: @match
|
render json: @match
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue