Repository navigation
fix(assets): bounded sorted lists, escaped search, trigram index - #1678
Merged
yusuftomilola merged 2 commits intoOct 17, 2026
Merged
yusuftomilola merged 2 commits into
yusuftomilola merged 2 commits into
Conversation
|
@amberly-d is attempting to deploy a commit to the naijabuz's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@amberly-d Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
2 tasks
This file contains hidden or 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
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.
Closes #1587
Closes #1586
Closes #1585
Closes #1584
Summary
limitand offer no sorting #1584: assets and users list endpoints now take a validated query DTO extending the sharedPaginationQueryDto:page >= 1,limit1-100 (anything above returns 400; the services also clamp to 100 as defence in depth), and a whitelistedsortBy/sortOrder. Ordering always ends with anidtiebreaker so pages are stable. Users gain the same sort options and an enum-validatedrole.%term%ILIKE patterns without escaping and has no supporting index #1585: search terms have%,_and\escaped (ESCAPE '\'), so100%matches literal text only, for assets and users. Adds migrationAddAssetSearchTrigramIndexes(pg_trgmGIN indexes onname,assetTag,serialNumber). The migration is guarded so it is a no-op if theassetstable doesn't exist yet.statusandconditionare free-form strings with no database or DTO constraint #1587 are not implemented in this PR (only 2 of the 4 assigned issues are addressed).Behaviour change to note: invalid
limit/sortBy/rolevalues onGET /assetsandGET /usersnow return 400 instead of being ignored. Other list endpoints (departments, vendors etc.) already usePaginationQueryDto.Linked issues
Closes #1587, #1586, #1585, #1584 (see top of description)
Checks
.envvalues are committedNot run: dependencies were not installed in this workflow, so lint, build and tests were not executed. The migration and the EXPLAIN acceptance criterion were not run against a database. The
pg_trgmextension needs a role allowed to create extensions.