Call Interactor to Update the Match Score with correct score and state

This commit is contained in:
Daniel Schädler 2019-04-16 20:37:42 +02:00
parent b86eec4a6a
commit 10d000231f
1 changed files with 2 additions and 1 deletions

View File

@ -12,7 +12,8 @@ class MatchScoresController < ApplicationController
# PATCH/PUT /scores/1 # PATCH/PUT /scores/1
def update def update
if @match_score.update(match_score_params) result = UpdateMatchScore.call(match_score: @match_score, match_score_params: match_score_params)
if result.success?
render json: @match_score render json: @match_score
else else
render json: @match_score.errors, status: :unprocessable_entity render json: @match_score.errors, status: :unprocessable_entity