Skip to content

Commit

Permalink
fix deleCcomment error
Browse files Browse the repository at this point in the history
  • Loading branch information
admin authored and admin committed Apr 1, 2019
1 parent 3a57326 commit f75c93b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 22 deletions.
23 changes: 12 additions & 11 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 2 additions & 9 deletions src/Controller/DeleteCommentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,14 @@ public function __invoke(ServerRequestInterface $request,
ResponseInterface $response,
Container $container
) {
if(array_key_exists('auth', $_SESSION)) {
$posts = $this->users->allArticlesByPseudo(
$_SESSION['auth']->getPseudo()
);
}
$comments = $this->comment->getCommentForvalidated(
$request->getAttribute('comments', 0)
);
var_dump($comments);
exit;

$email = $comments['email'];

$deleteComment = $this->comment->deleteComment($request->getAttribute('comments'));
var_dump($deleteComment);
exit;


if($deleteComment) {
$this->setFlash('success', 'Le commentaire a bien été supprimé');
Expand Down
5 changes: 3 additions & 2 deletions src/Repository/CommentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,9 @@ public function deleteComment(int $id)
{
return $this->database->request(
'DELETE
FROM comment WHERE id = :id', [
'id' => $id['id']
FROM comment
WHERE id = :id', [
'id' => $id
]
);
}
Expand Down

0 comments on commit f75c93b

Please sign in to comment.