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