From 64a770d99a6e12915f7b5c3a4536fa74465d036a Mon Sep 17 00:00:00 2001 From: Baptiste Lemoine Date: Fri, 24 Jan 2020 12:15:20 +0100 Subject: [PATCH] return polls as a poll field, not data --- src/Controller/DefaultController.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Controller/DefaultController.php b/src/Controller/DefaultController.php index 2e36392..be89c64 100644 --- a/src/Controller/DefaultController.php +++ b/src/Controller/DefaultController.php @@ -39,7 +39,7 @@ class DefaultController extends AbstractController { public function showMyPollsAction() { return $this->json( [ 'message' => 'here are your polls', - 'data' => new Poll(), + 'poll' => new Poll(), ] ); } @@ -56,7 +56,7 @@ class DefaultController extends AbstractController { return $this->json( [ 'message' => 'here are your polls', - 'data' => $data, + 'poll' => $data, ], 200 ); } @@ -214,7 +214,7 @@ class DefaultController extends AbstractController { return $this->json( [ 'message' => 'you created a poll ' . $precision, - 'data' => $newpoll, + 'poll' => $newpoll, 'password_protected' => is_string( $newpoll->getPassword() ), 'admin_key' => $newpoll->getAdminKey(), 'owner_modifier_token' => $foundOwner->getModifierToken(), @@ -272,7 +272,7 @@ class DefaultController extends AbstractController { } $returnedPoll = [ 'message' => 'your poll config', - 'data' => $poll, + 'poll' => $poll, 'stacks_count' => count( $poll->getStacksOfVotes() ), 'stacks' => $stacks, 'choices_count' => count( $poll->getChoices() ),