From 10d000231f59b8fc01378c2bbf5730d837b2d9f3 Mon Sep 17 00:00:00 2001 From: Malaber <32635600+Malaber@users.noreply.github.com> Date: Tue, 16 Apr 2019 20:37:42 +0200 Subject: [PATCH] Call Interactor to Update the Match Score with correct score and state --- app/controllers/match_scores_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/match_scores_controller.rb b/app/controllers/match_scores_controller.rb index 80c18ae..e0694fe 100644 --- a/app/controllers/match_scores_controller.rb +++ b/app/controllers/match_scores_controller.rb @@ -12,7 +12,8 @@ class MatchScoresController < ApplicationController # PATCH/PUT /scores/1 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 else render json: @match_score.errors, status: :unprocessable_entity