This commit is contained in:
Tykayn 2021-04-30 15:55:13 +02:00 committed by tykayn
parent 5bb76de67a
commit 5694a703fb
1 changed files with 1 additions and 14 deletions

View File

@ -212,19 +212,6 @@ class PollController extends EmailsController {
$data = $request->getContent();
$data = json_decode( $data, true );
// $serializer = SerializerBuilder::create()->build();
// try {
// $newpoll = $serializer->deserialize( $data, 'App\Entity\Poll', 'json' );
// } catch ( RuntimeException $e ) {
// return $this->json( [
// "message" => "Incorrect JSON in request",
// "expected" => $serializer->serialize( new Poll(), 'json' ),
//
//// "data" => json_decode( $data ),
// ],
// 400 );
// }
$newpoll = new Poll();
$newpoll
->setModificationPolicy( $data[ 'modification_policy' ] )
@ -375,7 +362,7 @@ class PollController extends EmailsController {
$poll = $foundOwner->getPolls()[ 0 ];
$comment = $foundOwner->getComments()[ 0 ];
$sent = $this->sendOwnerPollsAction( $foundOwner, $poll );
$sent = $this->sendOwnerPollsAction( $foundOwner );
if ( $sent ) {
return $this->json( [ "message" => "test email sent to " . $foundOwner->getEmail() . "!" ], 200 );
}