-
Notifications
You must be signed in to change notification settings - Fork 1
[fix] Begrens limit og escape spesialtegn i søk #79
Open
mariehd
wants to merge
11
commits into
main
Choose a base branch
from
73-fix-begrens-limit-og-escape-spesialtegn-i-søk
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+227
−27
Open
Changes from 4 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
a203bd4
[fix] Begrens limit og escape spesialtegn i GraphQL (#73)
mariehd e67165c
[test] Test limit-grenser og spesialtegn i søk (#73)
mariehd cad202c
[docs] Dokumenter API-grenser og søkehåndtering (#73)
mariehd 1218f87
Merge branch 'main' into 73-fix-begrens-limit-og-escape-spesialtegn-i…
mariehd e8fad4a
[fix] Rett UUID-validering i GraphQL (#73)
mariehd 5b9aec5
[fix] Valider offset og test UUID og søkeinput (#73)
mariehd 9f2f9b9
[test] Test negativ offset og backslash i GraphQL (#73)
mariehd 49ad8e3
[docs] Dokumenter offset-validering og tester (#73)
mariehd 482a3e3
[docs] Justerte linjene i project structure(#73)
mariehd 6420425
[test] Rydd opp etter code review (#73)
mariehd 0aa915d
[test] Gjør statussjekk i frontend-test mer robust (#73)
mariehd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| /** Maximum number of results returned per request. */ | ||
| export const MAX_PAGE_LIMIT = 100; | ||
| const DEFAULT_PAGE_LIMIT = 20; | ||
|
|
||
| /** Restrict page sizes to between 1 and 100. */ | ||
| export function normalizeLimit(limit: number | null | undefined): number { | ||
| return Math.min(Math.max(limit ?? DEFAULT_PAGE_LIMIT, 1), MAX_PAGE_LIMIT); | ||
| } | ||
|
|
||
| /** Escape special characters used by PostgreSQL ILIKE. */ | ||
| export function escapeLikeSearch(search: string | null | undefined): string | null { | ||
| return search == null ? null : search.replace(/[\\%_]/g, '\\$&'); | ||
| } |
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
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.