diff --git a/mealapi/resources/mealresource.py b/mealapi/resources/mealresource.py index 1918818..e020b8a 100644 --- a/mealapi/resources/mealresource.py +++ b/mealapi/resources/mealresource.py @@ -16,7 +16,8 @@ class MealBaseResource(Resource): body = request.get_json() try: - self.mealschema.load(body, session=db.session) + loadedobj = self.mealschema.load(body) + db.session.add(loadedobj) db.session.commit() return '', 204 except ValidationError as error: