sharktide commited on
Commit
06aff4f
Β·
verified Β·
1 Parent(s): e8a9849

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py CHANGED
@@ -85,6 +85,18 @@ def get_my_recipes(user_id):
85
  "rows": [{ "row": recipe } for recipe in data]
86
  }
87
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  # ───────────────────────────────
89
  # Health check
90
  @app.get("/status")
 
85
  "rows": [{ "row": recipe } for recipe in data]
86
  }
87
 
88
+ @app.get("/supabase/recipebyid")
89
+ async def get_recipe_by_id(id: str):
90
+ try:
91
+ response = supabase.table("recipes").select("*").eq("id", id).single().execute()
92
+ if response.data is None:
93
+ raise HTTPException(status_code=404, detail="Recipe not found")
94
+
95
+ return {"recipe": response.data}
96
+
97
+ except Exception as e:
98
+ raise HTTPException(status_code=500, detail=str(e))
99
+
100
  # ───────────────────────────────
101
  # Health check
102
  @app.get("/status")