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.
The profile page now shows:
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