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

Redirect to 404 page when posting does not exist #186

Merged
merged 4 commits into from
Mar 6, 2022

Conversation

briantu
Copy link
Member

@briantu briantu commented Mar 4, 2022

Ticket link

Closes #144

Implementation description

  • Added a /not-found route for NotFound.tsx component
  • In VolunteerPostingDetails.tsx, redirect to /not-found when posting does not exist
    • Note: I had to change the way the postingDetails variable was being set when calling useQuery, because before, loading and postingDetails could be false and null at the same time even though the posting exists

Steps to test

  1. Go to /volunteer/posting/{id} and replace id with a posting id you have created in your local database
  2. Check that the page still loads when the posting exists
  3. Try changing the id to one that does not exist and check that the page redirects to not found

What should reviewers focus on?

  • Code correctness

Checklist

  • My PR name is descriptive and in imperative tense
  • My commit messages are descriptive and in imperative tense. My commits are atomic and trivial commits are squashed or fixup'd into non-trivial commits
  • I have run the appropriate linter(s)
  • I have requested a review from the PL, as well as other devs who have background knowledge on this PR or who will be building on top of this PR

@briantu briantu requested review from sherryhli and LenaNguyen March 4, 2022 03:30
@briantu
Copy link
Member Author

briantu commented Mar 4, 2022

Oops, I think I have commits from my last PR because I didn't rebase 😅

@github-actions
Copy link

github-actions bot commented Mar 4, 2022

Visit the preview URL for this PR (updated for commit 9c8d75c):

https://sistering-dev--pr186-brian-posting-redire-ey6pjjm4.web.app

(expires Fri, 11 Mar 2022 03:41:11 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@briantu briantu force-pushed the brian/posting-redirect-to-404-page branch from fac983f to 9c8d75c Compare March 4, 2022 03:37
Copy link
Member

@LenaNguyen LenaNguyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice use of useQuery !

@briantu briantu merged commit a7463ec into main Mar 6, 2022
@briantu briantu deleted the brian/posting-redirect-to-404-page branch March 6, 2022 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Redirect to 404 page when posting does not exist
2 participants