-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
21929 - get reviews endpoint #2830
Conversation
|
headers=create_header(jwt, [STAFF_ROLE], 'user')) | ||
|
||
assert rv.status_code == HTTPStatus.OK | ||
assert 'reviews' in rv.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add some data to review table to verify this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working on it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have an initial view of what the future arguments should look like?
- sorting by different fields
- filtering on different fields
@classmethod | ||
def get_paginated_reviews(cls, page, limit): | ||
"""Return paginated reviews.""" | ||
query = db.session.query(Review).order_by(Review.creation_date.asc()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Yes, the default sort is oldest first. This is probably worth a comment, but then again, this code will be expanded soon to handle filtering and sorting by different fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I agree with Vysakh that it would be nice to have some test data in here.
Vysakh, could we merge this now (which would allow Arwen to call this) and then work on the test data?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM
Issue #: /bcgov/entity#21929
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the lear license (Apache 2.0).