mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 14:33:33 -07:00
fixup
Signed-off-by: Litchi Pi <litchi.pi@proton.me>
This commit is contained in:
parent
e183dd1dcd
commit
c32c9d4502
2 changed files with 5 additions and 5 deletions
|
@ -374,7 +374,7 @@ class RecipeController(BaseRecipeController):
|
|||
If you wish to update parts of the recipe only, use a PATCH request to this route
|
||||
"""
|
||||
try:
|
||||
recipe = self.service.update_one(slug, data, strict=True)
|
||||
recipe = self.service.update_one(slug, data)
|
||||
except Exception as e:
|
||||
self.handle_exceptions(e)
|
||||
|
||||
|
@ -399,7 +399,7 @@ class RecipeController(BaseRecipeController):
|
|||
lambda: defaultdict(list)
|
||||
)
|
||||
for recipe in data:
|
||||
r = self.service.update_one(recipe.id, recipe, strict=True) # type: ignore
|
||||
r = self.service.update_one(recipe.id, recipe) # type: ignore
|
||||
updated_by_group_and_household[r.group_id][r.household_id].append(r)
|
||||
|
||||
all_updated: list[Recipe] = []
|
||||
|
|
|
@ -402,15 +402,15 @@ class RecipeService(RecipeServiceBase):
|
|||
|
||||
return recipe
|
||||
|
||||
def update_one(self, slug_or_id: str | UUID, update_data: Recipe, strict: bool) -> Recipe:
|
||||
recipe = self._pre_update_check(slug_or_id, update_data, strict)
|
||||
def update_one(self, slug_or_id: str | UUID, update_data: Recipe) -> Recipe:
|
||||
recipe = self._pre_update_check(slug_or_id, update_data, True)
|
||||
|
||||
new_data = self.group_recipes.update(recipe.slug, update_data)
|
||||
self.check_assets(new_data, recipe.slug)
|
||||
return new_data
|
||||
|
||||
def patch_one(self, slug_or_id: str | UUID, patch_data: Recipe) -> Recipe:
|
||||
recipe: Recipe = self._pre_update_check(slug_or_id, patch_data)
|
||||
recipe: Recipe = self._pre_update_check(slug_or_id, patch_data, False)
|
||||
|
||||
new_data = self.group_recipes.patch(recipe.slug, patch_data.model_dump(exclude_unset=True))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue