Spaces:
Running
Running
adjusting how we expect supabase responses
Browse files- 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.
|
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]
|