fix: adjust api of get_diet_records
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
18213b3958
commit
1f9deccc89
|
@ -16,10 +16,11 @@ diet = APIBlueprint('diet', __name__)
|
|||
@diet.output(DietRecordsOut)
|
||||
@login_required
|
||||
def get_diet_records(query_data):
|
||||
user_id = query_data['user_id'] if query_data.get('user_id') else session['user_id']
|
||||
try:
|
||||
sort = query_data.get('sort', '-create_time')
|
||||
current_date = query_data.get('current_date', None)
|
||||
results = rpc.diet.get_all_by_user(session['user_id'],
|
||||
results = rpc.diet.get_all_by_user(user_id,
|
||||
sort=sort,
|
||||
current_date=current_date)
|
||||
except Exception as e:
|
||||
|
|
|
@ -5,6 +5,7 @@ from apiflask import fields
|
|||
class DietRecordsIn(Schema):
|
||||
sort = fields.String()
|
||||
current_date = fields.String()
|
||||
user_id = fields.String()
|
||||
|
||||
|
||||
class heartOut(Schema):
|
||||
|
|
Loading…
Reference in New Issue