-
Notifications
You must be signed in to change notification settings - Fork 5
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 logic check for if page is published if not 404 [WEB-2988] #642
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be cleaner to add a published()
scope to the item retrieval, so we won't get anything back if it's not published. That would be on the line right before this change:
$item = $this->repository->published()->getById((int) $id);
7eb6952
to
4bef2f4
Compare
Quality Gate passedIssues Measures |
@@ -149,7 +149,7 @@ protected function getNavElements($title) | |||
|
|||
public function show($id) | |||
{ | |||
$item = $this->repository->getById((int) $id); | |||
$item = $this->repository->published()->findOrFail((int) $id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nikhiltri the getById
method is a twill model method and not an eloquent one so I replaced it with the findOrFail which will 404 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Much better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! ⭐
…ses-published-statuts Add logic check for if page is published if not 404 [WEB-2988]
No description provided.