mirror of
https://framagit.org/tykayn/date-poll-api
synced 2023-08-25 08:23:11 +02:00
votestack and comment add
This commit is contained in:
parent
80abd003ae
commit
d885a3b947
@ -3,6 +3,7 @@
|
||||
namespace App\Controller\api;
|
||||
|
||||
use App\Controller\EmailsController;
|
||||
use App\Entity\Comment;
|
||||
use App\Entity\Owner;
|
||||
use App\Entity\Poll;
|
||||
use App\Entity\StackOfVotes;
|
||||
@ -78,6 +79,13 @@ class VoteController extends EmailsController {
|
||||
|
||||
// TODO manage new comment
|
||||
$emChoice = $choice_repository;
|
||||
$newComment = new Comment();
|
||||
$newComment->setPseudo($data ['pseudo'])
|
||||
->setPoll($poll)
|
||||
->setText($data['comment']);
|
||||
$owner->addComment($newComment);
|
||||
|
||||
$em->persist($newComment);
|
||||
|
||||
foreach ( $data[ 'votes' ] as $vote ) {
|
||||
if(!$vote[ 'value' ]){
|
||||
|
Loading…
Reference in New Issue
Block a user