Skip to content

Commit

Permalink
fix(requestlist): use default value of sort direction only if valid
Browse files Browse the repository at this point in the history
The Sort Direction was loaded with values from the localStorage, but `undefined` was assigned if no
previous Sort Direction existed, causing the client to send undefined as a string for the Sort
Direction.

fix #1147
  • Loading branch information
gauthier-th committed Dec 21, 2024
1 parent 59b7859 commit 15d595f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions overseerr-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5448,6 +5448,7 @@ paths:
schema:
type: string
enum: [asc, desc]
nullable: true
default: desc
- in: query
name: requestedBy
Expand Down
4 changes: 3 additions & 1 deletion src/components/RequestList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ const RequestList = () => {

setCurrentFilter(filterSettings.currentFilter);
setCurrentSort(filterSettings.currentSort);
setCurrentSortDirection(filterSettings.currentSortDirection);
setCurrentPageSize(filterSettings.currentPageSize);
if (['asc', 'desc'].includes(filterSettings.currentSortDirection)) {
setCurrentSortDirection(filterSettings.currentSortDirection);
}
}

// If filter value is provided in query, use that instead
Expand Down

0 comments on commit 15d595f

Please sign in to comment.