From 063bf5c18b85ee8a8463e75cf468222f6c46b34a Mon Sep 17 00:00:00 2001 From: BryantHe Date: Thu, 21 Sep 2023 15:29:34 +0800 Subject: [PATCH] fix: adjust api of get_records --- app/api/v1/record.py | 2 +- app/api/v1/schema/record.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/api/v1/record.py b/app/api/v1/record.py index b519010..07d5238 100644 --- a/app/api/v1/record.py +++ b/app/api/v1/record.py @@ -74,7 +74,7 @@ def get_records(query_data): current_date=current_date) except Exception as e: raise BodyRecordNotFound(extra_data={'error_docs': str(e)}) - return {'records': results} + return results @record.get('/chart') diff --git a/app/api/v1/schema/record.py b/app/api/v1/schema/record.py index dc70481..83c778f 100644 --- a/app/api/v1/schema/record.py +++ b/app/api/v1/schema/record.py @@ -32,6 +32,8 @@ class BodyRecordsIn(Schema): class BodyRecordsOut(Schema): records = fields.List(fields.Nested(BodyRecordOut)) + previous_date = fields.String() + next_date = fields.String() class BodyRecordChartIn(Schema):