Skip to content

Commit

Permalink
Add Post Show and remove current user
Browse files Browse the repository at this point in the history
  • Loading branch information
Tresor-ilunga committed Oct 14, 2023
1 parent 5b9ac4b commit 21d7356
Show file tree
Hide file tree
Showing 4 changed files with 14,247 additions and 5 deletions.
Binary file added public/coverImage.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13,569 changes: 13,567 additions & 2 deletions public/sw.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use Symfony\Component\HttpKernel\Attribute\AsController;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Requirement\Requirement;
use Symfony\Component\Security\Http\Attribute\CurrentUser;

/**
* class PostController.
Expand Down Expand Up @@ -61,7 +60,6 @@ public function feed(PostRepositoryInterface $repository): Response
public function show(
string $slug,
Post $item,
#[CurrentUser] User $user,
EventDispatcherInterface $dispatcher
): Response {
if ($item->getSlug() !== $slug) {
Expand All @@ -75,6 +73,8 @@ public function show(
);
}

/** @var User|null $user */
$user = $this->getUser();
$dispatcher->dispatch(new ContentViewedEvent($item, (string) $this->getCurrentRequest()->getClientIp(), $user));

return $this->render(
Expand Down
Loading

0 comments on commit 21d7356

Please sign in to comment.