uwblueprint / sistering

Sistering's volunteer scheduling and management web application.
https://volunteer.sistering.org
8 stars 0 forks source link

Only show volunteer posting details if user in branch #637

Closed briantu closed 1 year ago

briantu commented 1 year ago

Ticket link

Closes #612

Implementation description

Steps to test

  1. Log in as volunteer
  2. Try to see posting details for branch current volunteer is not in
  3. Check you are redirected to not found page

What should reviewers focus on?

Checklist

briantu commented 1 year ago

This fix works, but not sure if it's the best way to do it cuz it's a bit messy. Lmk if this is okay - if it is, then I'll also do it for the volunteer posting availabilities page!

github-actions[bot] commented 1 year ago

Visit the preview URL for this PR (updated for commit 8e566d0):

https://sistering-dev--pr637-brian-only-show-post-6joolkii.web.app

(expires Tue, 30 Aug 2022 00:07:42 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

briantu commented 1 year ago

hmm would it make more sense to do this on the server side instead? ie: for the posting query, if the current user is a volunteer, make sure the posting is in the same branch as the volunteer, otherwise, on error we redirect instead of showing a toast @briantu would that be better?

Wait yeah that sounds like a better solution