Update app.py
Browse files
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")
|