return polls as a poll field, not data
This commit is contained in:
parent
bead44c6bd
commit
64a770d99a
|
@ -39,7 +39,7 @@ class DefaultController extends AbstractController {
|
||||||
public function showMyPollsAction() {
|
public function showMyPollsAction() {
|
||||||
return $this->json( [
|
return $this->json( [
|
||||||
'message' => 'here are your polls',
|
'message' => 'here are your polls',
|
||||||
'data' => new Poll(),
|
'poll' => new Poll(),
|
||||||
] );
|
] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ class DefaultController extends AbstractController {
|
||||||
|
|
||||||
return $this->json( [
|
return $this->json( [
|
||||||
'message' => 'here are your polls',
|
'message' => 'here are your polls',
|
||||||
'data' => $data,
|
'poll' => $data,
|
||||||
],
|
],
|
||||||
200 );
|
200 );
|
||||||
}
|
}
|
||||||
|
@ -214,7 +214,7 @@ class DefaultController extends AbstractController {
|
||||||
|
|
||||||
return $this->json( [
|
return $this->json( [
|
||||||
'message' => 'you created a poll ' . $precision,
|
'message' => 'you created a poll ' . $precision,
|
||||||
'data' => $newpoll,
|
'poll' => $newpoll,
|
||||||
'password_protected' => is_string( $newpoll->getPassword() ),
|
'password_protected' => is_string( $newpoll->getPassword() ),
|
||||||
'admin_key' => $newpoll->getAdminKey(),
|
'admin_key' => $newpoll->getAdminKey(),
|
||||||
'owner_modifier_token' => $foundOwner->getModifierToken(),
|
'owner_modifier_token' => $foundOwner->getModifierToken(),
|
||||||
|
@ -272,7 +272,7 @@ class DefaultController extends AbstractController {
|
||||||
}
|
}
|
||||||
$returnedPoll = [
|
$returnedPoll = [
|
||||||
'message' => 'your poll config',
|
'message' => 'your poll config',
|
||||||
'data' => $poll,
|
'poll' => $poll,
|
||||||
'stacks_count' => count( $poll->getStacksOfVotes() ),
|
'stacks_count' => count( $poll->getStacksOfVotes() ),
|
||||||
'stacks' => $stacks,
|
'stacks' => $stacks,
|
||||||
'choices_count' => count( $poll->getChoices() ),
|
'choices_count' => count( $poll->getChoices() ),
|
||||||
|
|
Loading…
Reference in New Issue