Exemplo n.º 1
0
def update_meal_plan(plan_id: str,
                     meal_plan: MealPlan,
                     session: Session = Depends(generate_session)):
    """ Updates a meal plan based off ID """
    meal_plan.process_meals(session)
    meal_plan.update(session, plan_id)

    return SnackResponse.info("Mealplan Updated")
Exemplo n.º 2
0
async def update_meal_plan(plan_id: str, meal_plan: MealPlan):
    """ Updates a meal plan based off ID """

    try:
        meal_plan.process_meals()
        meal_plan.update(plan_id)
    except:
        raise HTTPException(
            status_code=404,
            detail=SnackResponse.error("Unable to Update Mealplan"),
        )

    return SnackResponse.success("Mealplan Updated")