具有输入sf2的Ajax更新实体

I ask you because I am stuck on a problem (I have previously searched).

I would like, from an input field, update the database without the user noticing.

My code :

<script>
        function updateResult(str, idg, idt) {
            if (str.length == 0)
                return;
            else
//                alert("data : " + str + "; id_game : " + idg + "; id_team : " + idt);

                $.ajax({
                        url: Routing.generate('basket_admin_tournament_update', { "game_id": idg, "team_id": idt, "score": str}),
                        type: "POST"
                        data: { game_id : idg, team_id: idt, score: str },
                        success: function(data) {
                                alert('ok');
                        },
                        error: function() {
                                alert('error');
                        }
                });

        }
    </script>

PHP

// revoir les espaces dans les noms des tournois
    /**
     * @ParamConverter("tournament", options={"mapping": {"tournament_name": "name"}})
     */
    public function showAction(Tournament $tournament) {
        return $this->render('BasketTournamentBundle:Tournament:show.html.twig', array(
                    'tournament' => $tournament
        ));
    }

    public function updateAction($game_id, $team_id, $score) {
        $em = $this->getDoctrine()->getManager('tournament');

        $game = $em
                ->getRepository('BasketTournamentBundle:Tournament')
                ->findOneBy($game_id);

        if ($team_id == $game->getTeam1()) {
                $game->setScoreTeam1($score);
                $em->persist($game);
                $em->flush();
        } else {
                $game->setScoreTeam2($score);
                $em->persist($game);
                $em->flush();
        }

        return new Response();
    }


    <h3>Planning</h3>
{% for game in step.games %}
  {% if (game.team1 in pool.teams) or (game.team2 in pool.teams) %}
    <p>{{ game.dateGame|date('h:m:s') }} : {{ game.team1.name }} <input type="text"   onblur="updateResult(this.value, {{ game.id }}, {{ game.team1.id }})"> - <input type="text" onblur="updateResult(this.value, {{ game.id }}, {{ game.team2.id }})"> {{ game.team2.name }}</p>
  {% endif %}
{% endfor %}

I get my data well in the alert.

I can not update my entity..