diff --git a/mealapi/resources/mealresource.py b/mealapi/resources/mealresource.py index ac3c7ff..1918818 100644 --- a/mealapi/resources/mealresource.py +++ b/mealapi/resources/mealresource.py @@ -17,6 +17,7 @@ class MealBaseResource(Resource): try: self.mealschema.load(body, session=db.session) + db.session.commit() return '', 204 except ValidationError as error: abort(406, error.messages) diff --git a/mealapi/schemas/mealschema.py b/mealapi/schemas/mealschema.py index 0849a7b..41f56b8 100644 --- a/mealapi/schemas/mealschema.py +++ b/mealapi/schemas/mealschema.py @@ -6,7 +6,6 @@ from .ingredientschema import IngredientSchema class MealSchema(ma.SQLAlchemyAutoSchema): - # A list of author objects ingredients = ma.Nested(IngredientSchema, many=True) class Meta: