update vote stack methods and routes

This commit is contained in:
Tykayn 2021-06-07 09:32:44 +02:00 committed by tykayn
parent 8c03b1c521
commit 57adb29cb9
1 changed files with 4 additions and 8 deletions

View File

@ -28,7 +28,7 @@ class VoteController extends EmailsController {
/**
* add a vote stack on a poll
* @Route(
* path = "/poll/{custom_url}/answer",
* path = "/vote-stack",
* name = "new_vote_stack",
* methods={"POST","OPTIONS"}
* )
@ -83,7 +83,6 @@ class VoteController extends EmailsController {
->setPseudo( $data[ 'owner' ][ "email" ] )
->addStackOfVote( $newStack );
// TODO manage new comment
$emChoice = $choice_repository;
$newComment = new Comment();
$newComment->setPseudo( $data [ 'pseudo' ] )
@ -126,21 +125,18 @@ class VoteController extends EmailsController {
$this->sendVoteNotificationAction( $newStack->getOwner(), $newStack );
}
return $this->json( [
'poll' => $poll->display(),
] );
return $this->json( $newStack->display() );
}
/**
* update vote stack
* @Patch(
* @Route(
* path = "/vote-stack/{id}/token/{modifierToken}",
* name = "update_vote_stack",
* requirements = { "id"="\d+"}
* methods={"PATCH","OPTIONS"}
* )
*
* @param SerializerInterface $serializer
* @param StackOfVotes $id
* @param $modifierToken