mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2026-01-05 06:08:36 -05:00
fix(requestlist): use default value of sort direction only if valid (#1174)
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
This commit is contained in:
@@ -5448,6 +5448,7 @@ paths:
|
|||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
enum: [asc, desc]
|
enum: [asc, desc]
|
||||||
|
nullable: true
|
||||||
default: desc
|
default: desc
|
||||||
- in: query
|
- in: query
|
||||||
name: requestedBy
|
name: requestedBy
|
||||||
|
|||||||
@@ -87,8 +87,10 @@ const RequestList = () => {
|
|||||||
|
|
||||||
setCurrentFilter(filterSettings.currentFilter);
|
setCurrentFilter(filterSettings.currentFilter);
|
||||||
setCurrentSort(filterSettings.currentSort);
|
setCurrentSort(filterSettings.currentSort);
|
||||||
setCurrentSortDirection(filterSettings.currentSortDirection);
|
|
||||||
setCurrentPageSize(filterSettings.currentPageSize);
|
setCurrentPageSize(filterSettings.currentPageSize);
|
||||||
|
if (['asc', 'desc'].includes(filterSettings.currentSortDirection)) {
|
||||||
|
setCurrentSortDirection(filterSettings.currentSortDirection);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If filter value is provided in query, use that instead
|
// If filter value is provided in query, use that instead
|
||||||
|
|||||||
Reference in New Issue
Block a user