voluntree-uk / app-next

NextJS Application for Voluntree
https://platform.voluntree.net
1 stars 0 forks source link

Profile extension #41

Closed mika018 closed 1 year ago

mika018 commented 1 year ago

The profile page now shows:

Screenshot from 2022-09-28 16-27-56 (click on image for full page view)

I decided to just show number of hosted workshops for now. It is stored as a field in the profiles table. I have also updated the database schema wiki page to reflect the addition of that column and documentation of additional two remote procedure calls for incrementing and decrementing this value. These RPCs are to be called when booking and cancelling the workshops respectively. I used RPCs because there is no way to increment this value with a single supabase call as we would need to first get the value and then write it.

Alternatively, we can check how many workshops are hosted by the user every time we are showing the profile page but that seems like an overkill, especially with the increasing number of workshops and users. Maintaining the hosted workshops counter seems like a more performant approach to me.

Any design and/or approach feedback is welcome.

Closes #33