andykr1k commited on
Commit
41305e5
·
1 Parent(s): d2b6dbf

added types to post outside of app

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -158,10 +158,14 @@ def fetch_full_post_records(post_ids):
158
  supabase = get_supabase_client()
159
  if not post_ids:
160
  return []
161
-
162
- # Query Supabase for all columns of the posts table where id is in the list of recommended post_ids
163
  response = supabase.table('posts').select('*').in_('id', post_ids).execute()
164
- return response.data
 
 
 
 
 
165
 
166
  @app.post("/rebuild")
167
  async def rebuild_handler():
 
158
  supabase = get_supabase_client()
159
  if not post_ids:
160
  return []
161
+
 
162
  response = supabase.table('posts').select('*').in_('id', post_ids).execute()
163
+ records = response.data
164
+
165
+ for record in records:
166
+ record['type'] = 'post'
167
+
168
+ return records
169
 
170
  @app.post("/rebuild")
171
  async def rebuild_handler():