fix: default null recipe quantities to zero when adding to shopping list (#1677)
* default null recipe quantities to zero * simplify validation * remove unused import Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
This commit is contained in:
parent
332870f608
commit
e088719ddc
1 changed files with 2 additions and 1 deletions
|
@ -8,13 +8,14 @@ from pydantic.utils import GetterDict
|
||||||
|
|
||||||
from mealie.db.models.group.shopping_list import ShoppingList, ShoppingListItem
|
from mealie.db.models.group.shopping_list import ShoppingList, ShoppingListItem
|
||||||
from mealie.schema._mealie import MealieModel
|
from mealie.schema._mealie import MealieModel
|
||||||
|
from mealie.schema._mealie.types import NoneFloat
|
||||||
from mealie.schema.recipe.recipe_ingredient import IngredientFood, IngredientUnit
|
from mealie.schema.recipe.recipe_ingredient import IngredientFood, IngredientUnit
|
||||||
from mealie.schema.response.pagination import PaginationBase
|
from mealie.schema.response.pagination import PaginationBase
|
||||||
|
|
||||||
|
|
||||||
class ShoppingListItemRecipeRef(MealieModel):
|
class ShoppingListItemRecipeRef(MealieModel):
|
||||||
recipe_id: UUID4
|
recipe_id: UUID4
|
||||||
recipe_quantity: float
|
recipe_quantity: NoneFloat = 0
|
||||||
|
|
||||||
|
|
||||||
class ShoppingListItemRecipeRefOut(ShoppingListItemRecipeRef):
|
class ShoppingListItemRecipeRefOut(ShoppingListItemRecipeRef):
|
||||||
|
|
Loading…
Reference in a new issue