|
|
|
@ -26,7 +26,7 @@ class VoteController extends FramadateController {
|
|
|
|
|
/**
|
|
|
|
|
* add a vote stack on a poll
|
|
|
|
|
* @Post(
|
|
|
|
|
* path = "/poll/{id}/vote",
|
|
|
|
|
* path = "/poll/{id}/answer",
|
|
|
|
|
* name = "new_vote_stack",
|
|
|
|
|
* requirements = {"content"="\w+", "poll_id"="\d+"}
|
|
|
|
|
* )
|
|
|
|
@ -119,20 +119,7 @@ class VoteController extends FramadateController {
|
|
|
|
|
$this->sendVoteNotificationAction($stack->getOwner(), $stack);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$returnedVoteStack = [
|
|
|
|
|
'message' => 'you created a vote stack' . $precision,
|
|
|
|
|
'poll' => $poll,
|
|
|
|
|
'vote_stack' => $stack,
|
|
|
|
|
'stacks' => $stacks,
|
|
|
|
|
'comments' => $poll->getComments(),
|
|
|
|
|
'choices' => $poll->getChoices(),
|
|
|
|
|
'choices_count' => $poll->computeAnswers(),
|
|
|
|
|
'vote_count' => count( $stacks ),
|
|
|
|
|
'owner' => $stack->getOwner(),
|
|
|
|
|
'owner_modifier_token' => $stack->getOwner()->getModifierToken(),
|
|
|
|
|
'admin_key' => $poll->getAdminKey(),
|
|
|
|
|
'json_you_sent' => $data,
|
|
|
|
|
];
|
|
|
|
|
$returnedVoteStack = $stack;
|
|
|
|
|
|
|
|
|
|
$jsonResponse = $serializer->serialize($returnedVoteStack, 'json');
|
|
|
|
|
|
|
|
|
@ -219,11 +206,11 @@ class VoteController extends FramadateController {
|
|
|
|
|
|
|
|
|
|
return $this->json( [
|
|
|
|
|
'message' => 'boom! les ' . $length . ' votes du sondage ont été supprimés',
|
|
|
|
|
] );
|
|
|
|
|
],200 );
|
|
|
|
|
} else {
|
|
|
|
|
return $this->json( [
|
|
|
|
|
'message' => 'le token d\'autorisation est invalide, vous ne pouvez pas modifier ce sondage',
|
|
|
|
|
] );
|
|
|
|
|
'message' => 'le token d\'autorisation est invalide, vous ne pouvez pas modifier ce sondage'
|
|
|
|
|
],403 );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|