Skip to content

Commit

Permalink
fix(pydiscordsh): fixed the health status of the supabase connection.
Browse files Browse the repository at this point in the history
  • Loading branch information
h0lybyte committed Jan 11, 2025
1 parent 7627726 commit 4ae184b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apps/pydiscordsh/pydiscordsh/apps/kilobase.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ def verify_jwt(self, token: str) -> dict:

def get_user_by_id(self, user_id: str):
"""
Fetch a user's data from the Supabase `users` table.
Fetch a user's data from the Supabase `user_profiles` table.
Args:
user_id (str): The user ID to query.
Returns:
dict: User data or None if not found.
"""
response = self.client.table("users").select("*").eq("id", user_id).single().execute()
response = self.client.table("user_profiles").select("*").eq("id", user_id).single().execute()
return response.data if response.data else None

def extract_user_id(self, token: str) -> str:
Expand Down Expand Up @@ -109,7 +109,7 @@ def health_status(self) -> dict:
"""
try:
# Attempt a simple query to check the connection health
response = self.client.table("users").select("id").limit(1).execute()
response = self.client.table("user_profiles").select("id").limit(1).execute()

# Check if the response is valid
if response.data is not None:
Expand Down

0 comments on commit 4ae184b

Please sign in to comment.