Fixed saving recipe
This commit is contained in:
parent
676378b4fb
commit
1da1b0e097
1 changed files with 1 additions and 1 deletions
2
main.py
2
main.py
|
|
@ -104,7 +104,7 @@ async def get_recipe(recipe_id: int, conn: sqlite3.Connection = Depends(get_db))
|
||||||
|
|
||||||
return r
|
return r
|
||||||
|
|
||||||
@app.post('/recipes/')
|
@app.post('/api/recipes')
|
||||||
async def create_recipe(recipe: recipes.Recipe, conn: sqlite3.Connection = Depends(get_db), user: persons.Person = Depends(cookie_person)) -> recipes.Recipe:
|
async def create_recipe(recipe: recipes.Recipe, conn: sqlite3.Connection = Depends(get_db), user: persons.Person = Depends(cookie_person)) -> recipes.Recipe:
|
||||||
if not recipe.ingredients:
|
if not recipe.ingredients:
|
||||||
return JSONResponse(status_code=400, content={'message': 'Recipe must have at least one ingredient'})
|
return JSONResponse(status_code=400, content={'message': 'Recipe must have at least one ingredient'})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue