Fix db_utils
This commit is contained in:
parent
d5be5d1c40
commit
7e81f6ed88
@ -81,9 +81,9 @@ def update_recipe_db(recipe_id: int, recipe_data: Dict[str, Any]) -> Optional[Di
|
||||
SET name = %s,
|
||||
meal_type = %s,
|
||||
time_minutes = %s,
|
||||
tags = %s,
|
||||
ingredients = %s,
|
||||
steps = %s,
|
||||
tags = %s::jsonb,
|
||||
ingredients = %s::jsonb,
|
||||
steps = %s::jsonb,
|
||||
image = %s,
|
||||
made_by = %s
|
||||
WHERE id = %s
|
||||
@ -136,7 +136,7 @@ def create_recipe_db(recipe_data: Dict[str, Any]) -> Dict[str, Any]:
|
||||
cur.execute(
|
||||
"""
|
||||
INSERT INTO recipes (name, meal_type, time_minutes, tags, ingredients, steps, image, made_by, user_id)
|
||||
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)
|
||||
VALUES (%s, %s, %s, %s::jsonb, %s::jsonb, %s::jsonb, %s, %s, %s)
|
||||
RETURNING id, name, meal_type, time_minutes, tags, ingredients, steps, image, made_by, user_id
|
||||
""",
|
||||
(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user