PublicDataWorks / verdad-frontend

MIT License
0 stars 0 forks source link

[Backend] Implement RPC Function to Set Up User Profile in Supabase #16

Open linear[bot] opened 2 hours ago

linear[bot] commented 2 hours ago

Implement an RPC function named setup_profile to set up user profile when they click on the invitation link in the email. The function should take the following parameters:

Acceptance Criteria:

  1. Function Implementation:
    • Implement the setup_profile RPC function in Supabase.
  2. Request and Response:

    • The function should be callable using the Supabase client as follows:

      supabase_client.rpc('setup_profile', {'first_name': first_name, 'last_name': last_name, 'password': password, 'avatar_url': avatar_url}).execute()
    • The function should return a response in the following format:

      {
      "status": "success",
      "message": "Profile updated successfully"
      }
  3. Post-Onboarding Capabilities:
    • Ensure that once the profile setup is complete, the user can:
      • Log in using their password.
      • See their avatar displayed on the homepage.
      • Have their full name displayed in Supabase, formatted as first_name + last_name.
  4. Future Considerations:
    • Note that displaying the user's full name on the frontend will be handled in a separate story.

Notes:

Tasks:

linear[bot] commented 2 hours ago

VER-77 [Backend] Implement RPC Function to Set Up User Profile in Supabase