diff --git a/app/api/v1/record.py b/app/api/v1/record.py index e65dcea..8165705 100644 --- a/app/api/v1/record.py +++ b/app/api/v1/record.py @@ -47,7 +47,10 @@ def get_record(record_id): def get_records(query_data): try: sort = query_data.get('sort', '-create_time') - results = rpc.body_record.get_all_by_user(session['user_id'], sort) + current_date = query_data.get('current_date', None) + results = rpc.body_record.get_all_by_user(session['user_id'], + sort=sort, + current_date=current_date) except Exception as e: raise BodyRecordNotFound(extra_data={'error_docs': str(e)}) return {'records': results} diff --git a/app/api/v1/schema/record.py b/app/api/v1/schema/record.py index cd01560..e021ba5 100644 --- a/app/api/v1/schema/record.py +++ b/app/api/v1/schema/record.py @@ -19,6 +19,7 @@ class BodyRecordOut(Schema): class BodyRecordsIn(Schema): sort = fields.String() + current_date = fields.String() class BodyRecordsOut(Schema):