1
0
mirror of https://framagit.org/tykayn/date-poll-api synced 2023-08-25 08:23:11 +02:00

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

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