mirror of
https://framagit.org/tykayn/date-poll-api
synced 2023-08-25 08:23:11 +02:00
hop
This commit is contained in:
parent
5bb76de67a
commit
5694a703fb
@ -212,19 +212,6 @@ class PollController extends EmailsController {
|
|||||||
$data = $request->getContent();
|
$data = $request->getContent();
|
||||||
$data = json_decode( $data, true );
|
$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 = new Poll();
|
||||||
$newpoll
|
$newpoll
|
||||||
->setModificationPolicy( $data[ 'modification_policy' ] )
|
->setModificationPolicy( $data[ 'modification_policy' ] )
|
||||||
@ -375,7 +362,7 @@ class PollController extends EmailsController {
|
|||||||
$poll = $foundOwner->getPolls()[ 0 ];
|
$poll = $foundOwner->getPolls()[ 0 ];
|
||||||
$comment = $foundOwner->getComments()[ 0 ];
|
$comment = $foundOwner->getComments()[ 0 ];
|
||||||
|
|
||||||
$sent = $this->sendOwnerPollsAction( $foundOwner, $poll );
|
$sent = $this->sendOwnerPollsAction( $foundOwner );
|
||||||
if ( $sent ) {
|
if ( $sent ) {
|
||||||
return $this->json( [ "message" => "test email sent to " . $foundOwner->getEmail() . "!" ], 200 );
|
return $this->json( [ "message" => "test email sent to " . $foundOwner->getEmail() . "!" ], 200 );
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user