def delete_ingredient( ingredient_id: int, service: AbstractRecipeService = Depends(create_recipe_service), token=Depends(oauth2_scheme), ): get_username_from_token(token) return service.delete_ingredient(ingredient_id)
def update_recipe( recipe_id: int, recipe: RecipeCreate, service: AbstractRecipeService = Depends(create_recipe_service), token=Depends(oauth2_scheme), ): return service.update_recipe(get_username_from_token(token), recipe_id, recipe)
def get_ingredients( service: AbstractRecipeService = Depends(create_recipe_service), token=Depends(oauth2_scheme)): get_username_from_token(token) return service.get_ingredients()
def get_recipe_types( service: AbstractRecipeService = Depends(create_recipe_service), token=Depends(oauth2_scheme)): return service.get_recipe_types(get_username_from_token(token))