Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Post Show and remove current user #30

Merged
merged 5 commits into from
Oct 28, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add Post Show and remove current user
Tresor-ilunga committed Oct 14, 2023
commit 21d7356b6f3a8d6624f609e6fb7ad4cae098cacf
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
@@ -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.
@@ -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) {
@@ -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(
679 changes: 678 additions & 1 deletion templates/app/domain/content/blog/post/show.html.twig

Large diffs are not rendered by default.