wozwize commited on
Commit
148b44f
·
1 Parent(s): d6d7ec6

adjusting how we expect supabase responses

Browse files
Files changed (1) hide show
  1. app/routers/analyze.py +1 -1
app/routers/analyze.py CHANGED
@@ -67,7 +67,7 @@ async def analyze_article(request: ArticleRequest) -> AnalysisResponse:
67
  # Check if the article has already been analyzed
68
  existing_article = await supabase.table('article_analysis').select('*').eq('url', str(request.url)).execute()
69
 
70
- if existing_article.status_code == 200 and existing_article.data:
71
  logger.info("Article already analyzed. Returning cached data.")
72
  # Return the existing analysis result if it exists
73
  cached_data = existing_article.data[0]
 
67
  # Check if the article has already been analyzed
68
  existing_article = await supabase.table('article_analysis').select('*').eq('url', str(request.url)).execute()
69
 
70
+ if existing_article.data and len(existing_article.data) > 0:
71
  logger.info("Article already analyzed. Returning cached data.")
72
  # Return the existing analysis result if it exists
73
  cached_data = existing_article.data[0]