forked from bloom-housing/bloom
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Allow for the GET /listings
request param to specify how the results should be ordered
#548
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…/bloom into 193/sort-listings-by-param
…/bloom into 193/sort-listings-by-param
…/bloom into 193/sort-listings-by-param
…/bloom into 193/sort-listings-by-param
…/bloom into 193/sort-listings-by-param
…/bloom into 193/sort-listings-by-param
avaleske
approved these changes
Sep 10, 2021
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
anders-schneider
added a commit
that referenced
this pull request
Sep 10, 2021
…s should be ordered (#548) * Add field to ListingsQueryParam (still need to add tests) * Fix code style issues with Prettier * Update frontend to request listings sorted by mostRecentlyUpdated * Fix code style issues with Prettier * Add tests * Fix code style issues with Prettier * Add an error test and a comment * Small test change * Fix code style issues with Prettier * Test change * Refactor getOrderByCondition * Update comment * Fix code style issues with Prettier * Update enum value name * Fix code style issues with Prettier * Small updates * Update changelog * Update changelog * Whoops one more change to the changelog * Fix code style issues with Prettier * Update test names * Fix code style issues with Prettier Co-authored-by: Lint Action <lint-action@samuelmeuli.com>
seanmalbert
pushed a commit
that referenced
this pull request
Sep 14, 2021
* Sort listings (returned by `GET /listings`) by `updatedAt` (#542) * Add a simple ordering by updated_at * Change the helper function name * Add comments, update changelog * Fix code style issues with Prettier * Add a test for interaction of pagination and sorting * Fix code style issues with Prettier Co-authored-by: Lint Action <lint-action@samuelmeuli.com> * Fix the ordering of unit summaries returned by `GET /listings` (#547) * Order full listings query by unit summary number of bedrooms * Fix code style issues with Prettier Co-authored-by: Lint Action <lint-action@samuelmeuli.com> * Allow for the `GET /listings` request param to specify how the results should be ordered (#548) * Add field to ListingsQueryParam (still need to add tests) * Fix code style issues with Prettier * Update frontend to request listings sorted by mostRecentlyUpdated * Fix code style issues with Prettier * Add tests * Fix code style issues with Prettier * Add an error test and a comment * Small test change * Fix code style issues with Prettier * Test change * Refactor getOrderByCondition * Update comment * Fix code style issues with Prettier * Update enum value name * Fix code style issues with Prettier * Small updates * Update changelog * Update changelog * Whoops one more change to the changelog * Fix code style issues with Prettier * Update test names * Fix code style issues with Prettier Co-authored-by: Lint Action <lint-action@samuelmeuli.com> * Revert changes to sites/public * Revert a couple Detroit-specific changes * Fix up a comment * Small formatting changes * Fix a lint error * Fix another small lint error Co-authored-by: Lint Action <lint-action@samuelmeuli.com>
seanmalbert
pushed a commit
that referenced
this pull request
Jun 23, 2022
…s should be ordered (#548) * Add field to ListingsQueryParam (still need to add tests) * Fix code style issues with Prettier * Update frontend to request listings sorted by mostRecentlyUpdated * Fix code style issues with Prettier * Add tests * Fix code style issues with Prettier * Add an error test and a comment * Small test change * Fix code style issues with Prettier * Test change * Refactor getOrderByCondition * Update comment * Fix code style issues with Prettier * Update enum value name * Fix code style issues with Prettier * Small updates * Update changelog * Update changelog * Whoops one more change to the changelog * Fix code style issues with Prettier * Update test names * Fix code style issues with Prettier Co-authored-by: Lint Action <lint-action@samuelmeuli.com>
seanmalbert
pushed a commit
that referenced
this pull request
Jun 23, 2022
* Sort listings (returned by `GET /listings`) by `updatedAt` (#542) * Add a simple ordering by updated_at * Change the helper function name * Add comments, update changelog * Fix code style issues with Prettier * Add a test for interaction of pagination and sorting * Fix code style issues with Prettier Co-authored-by: Lint Action <lint-action@samuelmeuli.com> * Fix the ordering of unit summaries returned by `GET /listings` (#547) * Order full listings query by unit summary number of bedrooms * Fix code style issues with Prettier Co-authored-by: Lint Action <lint-action@samuelmeuli.com> * Allow for the `GET /listings` request param to specify how the results should be ordered (#548) * Add field to ListingsQueryParam (still need to add tests) * Fix code style issues with Prettier * Update frontend to request listings sorted by mostRecentlyUpdated * Fix code style issues with Prettier * Add tests * Fix code style issues with Prettier * Add an error test and a comment * Small test change * Fix code style issues with Prettier * Test change * Refactor getOrderByCondition * Update comment * Fix code style issues with Prettier * Update enum value name * Fix code style issues with Prettier * Small updates * Update changelog * Update changelog * Whoops one more change to the changelog * Fix code style issues with Prettier * Update test names * Fix code style issues with Prettier Co-authored-by: Lint Action <lint-action@samuelmeuli.com> * Revert changes to sites/public * Revert a couple Detroit-specific changes * Fix up a comment * Small formatting changes * Fix a lint error * Fix another small lint error Co-authored-by: Lint Action <lint-action@samuelmeuli.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
Description
This change adds an
orderBy
field to theListingsQueryParams
so that requests toGET /listings
can indicate how the listings should be sorted. Currently there are only two options: order by most recently updated or by "application dates".("application dates" is the pre-existing behavior: order by soonest applicationDueDate, and then by earliest applicationOpenDate. Since "application dates" was the pre-existing behavior, this change preserves that as the default ordering if no
orderBy
param is specified.)A few other smaller notes:
innerFilteredQuery
because it doesn't return individual units.)sites/public
so that the full listings page requests listings with theorderBy=mostRecentlyUpdated
parameter.Type of change
How Can This Be Tested/Reviewed?
$ cd backend/core && yarn test
$ cd backend/core && yarn test:e2e:local
Checklist:
yarn generate:client
if I made backend changes