-
Notifications
You must be signed in to change notification settings - Fork 19
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
[Issue #3694] Add Sorting To Saved Opportunity #3846
Conversation
… 3694/saved-opp-sorting
… 3694/saved-opp-sorting
…er-grants-gov into 3694/saved-opp-sorting
elif order.sort_direction == SortDirection.DESCENDING: | ||
order_col = desc(column) | ||
if order.order_by == "close_date": | ||
order_cols.append(order_col.nullslast()) |
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.
I think the type checking issues might be because of this confusing it.
I also think we want this to be nulls_last(order_col)
based on: https://docs.sqlalchemy.org/en/20/core/sqlelement.html#sqlalchemy.sql.expression.nulls_last
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.
Updated
… 3694/saved-opp-sorting
@doug-s-nava Similar to saved search list endpoint endpoint for the |
… 3694/saved-opp-sorting
@babebe got it. I guess we need a ticket to switch over our saved opportunities call? |
Yup, you're right |
… 3694/saved-opp-sorting
@babebe - this change looks good, but want to be careful about merging it if it immediately breaks a feature the frontend is building. Can we work with Aaron/Doug to make sure they get changes in that might be needed? |
Talked to Aaron. I will be merging the backend, then the front-end changes will be merged in. |
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.
Approved
Summary
Fixes #{3694}
Time to review: 5 mins
Changes proposed
Updated route to POST endpoint to pass in pagination object
Added Input schema
UserSavedOpportunitiesRequestSchema
with pagination: can now sort with"created_at", "updated_at", "opportunity_title", "close_date"
defaulting toagency_code
Updated service func
get_saved_opportunities
to implement the pagination and return also return pagination infoUpdated Test