From 18213b39588fb93020ea3ea6e11279e7c1409e4d Mon Sep 17 00:00:00 2001 From: BryantHe Date: Thu, 21 Sep 2023 15:34:54 +0800 Subject: [PATCH] fix: adjust api of get_diet_records --- app/api/v1/diet.py | 2 +- app/api/v1/schema/diet.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/api/v1/diet.py b/app/api/v1/diet.py index 9206f37..c92c2a6 100644 --- a/app/api/v1/diet.py +++ b/app/api/v1/diet.py @@ -24,7 +24,7 @@ def get_diet_records(query_data): current_date=current_date) except Exception as e: raise DietRecordNotFound(extra_data={'error_docs': str(e)}) - return {'records': results} + return results @diet.get('/') diff --git a/app/api/v1/schema/diet.py b/app/api/v1/schema/diet.py index a1a6d73..e5f3e7a 100644 --- a/app/api/v1/schema/diet.py +++ b/app/api/v1/schema/diet.py @@ -34,4 +34,6 @@ class DietRecordOut(Schema): class DietRecordsOut(Schema): - records = fields.List(fields.Nested(DietRecordOut)) \ No newline at end of file + records = fields.List(fields.Nested(DietRecordOut)) + previous_date = fields.String() + next_date = fields.String() \ No newline at end of file