Open linear[bot] opened 1 week ago
Create two RPC functions in Supabase to retrieve user data:
get_users()
get_users_by_emails(emails)
Acceptance Criteria:
Sample Responses:
get_users() should return a response in the following format:
[ { "id": "68dabebb-0cd8-4eff-a5d3-797a6d0332c6", "email": "me@example.com", "raw_user_meta_data": {} }, { "id": "32705b60-36d2-40d1-b2cd-dff45014536b", "email": "phong.nguyen@stanyangroup.com", "raw_user_meta_data": { "iss": "https://accounts.google.com", "sub": "106046552322731182849", "name": "Phong Nguyen", "email": "phong.nguyen@stanyangroup.com", "picture": "https://lh3.googleusercontent.com/a/ACg8ocKzNhgpL8qfZGWo6eEZBsJ-PY6-PgI9OuKWQJwPlKFo-qZqoKIU=s96-c", "full_name": "Phong Nguyen", "avatar_url": "https://lh3.googleusercontent.com/a/ACg8ocKzNhgpL8qfZGWo6eEZBsJ-PY6-PgI9OuKWQJwPlKFo-qZqoKIU=s96-c", "provider_id": "106046552322731182849", "custom_claims": { "hd": "stanyangroup.com" }, "email_verified": true, "phone_verified": false } } // additional users ]
get_users_by_emails(emails) should be callable as:
get_users_by_emails('phong.nguyen@stanyangroup.com', 'dat.h.tran@stanyangroup.com')
It should return a response like:
[ { "id": "32705b60-36d2-40d1-b2cd-dff45014536b", "email": "phong.nguyen@stanyangroup.com", "raw_user_meta_data": { "iss": "https://accounts.google.com", "sub": "106046552322731182849", "name": "Phong Nguyen", "email": "phong.nguyen@stanyangroup.com", "picture": "https://lh3.googleusercontent.com/a/ACg8ocKzNhgpL8qfZGWo6eEZBsJ-PY6-PgI9OuKWQJwPlKFo-qZqoKIU=s96-c", "full_name": "Phong Nguyen", "avatar_url": "https://lh3.googleusercontent.com/a/ACg8ocKzNhgpL8qfZGWo6eEZBsJ-PY6-PgI9OuKWQJwPlKFo-qZqoKIU=s96-c", "provider_id": "106046552322731182849", "custom_claims": { "hd": "stanyangroup.com" }, "email_verified": true, "phone_verified": false } } // additional users ]
Notes:
Tasks:
VER-78 [Backend] Implement RPC Functions to Retrieve Users from Supabase
Create two RPC functions in Supabase to retrieve user data:
get_users()
: Returns all users.get_users_by_emails(emails)
: Returns users based on a provided list of emails.Acceptance Criteria:
get_users()
function to retrieve all users.get_users_by_emails(emails)
function to retrieve users based on a list of emails provided.Sample Responses:
get_users()
should return a response in the following format:get_users_by_emails(emails)
should be callable as:It should return a response like:
Notes:
Tasks:
get_users()
RPC function.get_users_by_emails(emails)
RPC function.