@@ -98,7 +98,9 @@ public function getFull(int $pollId): JSONResponse {
9898 #[FrontpageRoute(verb: 'POST ' , url: '/poll/add ' )]
9999 public function add (string $ type , string $ title , string $ votingVariant = Poll::VARIANT_SIMPLE ): JSONResponse {
100100 return $ this ->response (
101- fn () => $ this ->pollService ->add ($ type , $ title , $ votingVariant ),
101+ fn () => [
102+ 'poll ' => $ this ->pollService ->add ($ type , $ title , $ votingVariant )
103+ ],
102104 Http::STATUS_CREATED
103105 );
104106 }
@@ -147,7 +149,9 @@ public function sendConfirmation(int $pollId): JSONResponse {
147149 #[NoAdminRequired]
148150 #[FrontpageRoute(verb: 'PUT ' , url: '/poll/{pollId}/toggleArchive ' )]
149151 public function toggleArchive (int $ pollId ): JSONResponse {
150- return $ this ->response (fn () => $ this ->pollService ->toggleArchive ($ pollId ));
152+ return $ this ->response (fn () => [
153+ 'poll ' => $ this ->pollService ->toggleArchive ($ pollId )
154+ ]);
151155 }
152156
153157 /**
@@ -157,7 +161,9 @@ public function toggleArchive(int $pollId): JSONResponse {
157161 #[NoAdminRequired]
158162 #[FrontpageRoute(verb: 'DELETE ' , url: '/poll/{pollId} ' )]
159163 public function delete (int $ pollId ): JSONResponse {
160- return $ this ->response (fn () => ['poll ' => $ this ->pollService ->delete ($ pollId )]);
164+ return $ this ->response (fn () => [
165+ 'poll ' => $ this ->pollService ->delete ($ pollId )
166+ ]);
161167 }
162168
163169 /**
@@ -191,7 +197,9 @@ public function reopen(int $pollId): JSONResponse {
191197 #[NoAdminRequired]
192198 #[FrontpageRoute(verb: 'POST ' , url: '/poll/{pollId}/clone ' )]
193199 public function clone (int $ pollId ): JSONResponse {
194- return $ this ->response (fn () => ['poll ' => $ this ->clonePoll ($ pollId )]);
200+ return $ this ->response (fn () => [
201+ 'poll ' => $ this ->clonePoll ($ pollId )
202+ ]);
195203 }
196204
197205 private function clonePoll (int $ pollId ): Poll {
0 commit comments