Skip to content

Commit

Permalink
diet record bug fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
nimaafshar79 committed Jun 12, 2020
1 parent a46828d commit da6a6ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions foods/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def get_diet_records():
return {
"error": "user not found"
}, 404
results = DietRecord.query.filter(DietRecord.ownerId == user.id).order_by('generated_at desc') \
results = DietRecord.query.filter(DietRecord.ownerId == user.id).order_by(DietRecord.generatedAt.desc()) \
.limit(per_page) \
.offset((page - 1) * per_page).all()

Expand All @@ -261,4 +261,4 @@ def get_diet_records():
"time": diet_record.generatedAt
})

return payload
return jsonify(payload)

0 comments on commit da6a6ef

Please sign in to comment.