Skip to content

Commit

Permalink
stop using ...
Browse files Browse the repository at this point in the history
  • Loading branch information
nafiz1001 committed Dec 20, 2024
1 parent 87e4a6f commit 91c922f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/pagedItemsTable/PagedItemsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface PagedItemsActionsCallbacks {
setFilterCallback: (value: FilterValue, description: FilterDescription) => void
setFilterOptionsCallback: (description: FilterDescription, options: FilterOptions) => void
clearFiltersCallback: () => void
setSortByCallback: (...sortByList: SortBy[]) => void
setSortByCallback: (sortByList: SortBy[]) => void
setPageSizeCallback: (pageSize: number) => void
resetPagedItemsCallback: () => void
setStaleCallback: (stale: boolean) => void
Expand Down Expand Up @@ -123,7 +123,7 @@ function PagedItemsTable<T extends object>({
if (!Array.isArray(sorterResult)) {
sorterResult = [sorterResult]
}
setSortByCallback(...sorterResult
setSortByCallback(sorterResult
.sort((a, b) => {
const aSorter = a.column?.sorter
const bSorter = b.column?.sorter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export default function serializeFilterParamsWithDescriptions(filters: FilterSet
return params
}

export function serializeSortByParams(...sortByList: SortBy[]) {
export function serializeSortByParams(sortByList: SortBy[]) {
const prefixByOrder = {
'ascend': '',
'descend': '-',
Expand All @@ -125,5 +125,5 @@ export function serializeSortByParams(...sortByList: SortBy[]) {
* @returns
*/
export function filtersQueryParams(filters: FilterSet, sortByList: SortBy[]){
return {...serializeFilterParamsWithDescriptions(filters), ordering: serializeSortByParams(...sortByList)}
return {...serializeFilterParamsWithDescriptions(filters), ordering: serializeSortByParams(sortByList)}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ export function usePagedItemsActionsCallbacks(pagedItemActions: PagedItemsAction
dispatch(pagedItemActions.clearFilters())
}

const setSortByCallback = (...sortByList: SortBy[]) => {
dispatch(pagedItemActions.setSortBy(...sortByList))
const setSortByCallback = (sortByList: SortBy[]) => {
dispatch(pagedItemActions.setSortBy(sortByList))
}

const setPageSizeCallback =(pageSize: number) => {
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/models/paged_items_factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export interface PagedItemsActions {
setFilterOptions: (description: FilterDescription, options: FilterOptions) => FreezemanAsyncThunk<void>
removeFilter: (description: FilterDescription) => FreezemanAsyncThunk<void>
clearFilters: () => FreezemanAsyncThunk<void>
setSortBy: (...sortByList: SortBy[]) => FreezemanAsyncThunk<void>
setSortBy: (sortByList: SortBy[]) => FreezemanAsyncThunk<void>
setPageSize: (pageSize: number) => FreezemanAsyncThunk<void>
resetPagedItems: () => FreezemanAsyncThunk<void>
setStale: (stale: boolean) => FreezemanAsyncThunk<void>
Expand Down Expand Up @@ -142,7 +142,7 @@ export function createPagedItemsActions<Prefix extends string, M extends FMSTrac
const { filters, fixedFilters, sortByList } = pagedItems

const serializedFilters = serializeFilterParamsWithDescriptions({ ...fixedFilters, ...filters })
const ordering = serializeSortByParams(...sortByList)
const ordering = serializeSortByParams(sortByList)

const params = {
offset,
Expand Down Expand Up @@ -231,7 +231,7 @@ export function createPagedItemsActions<Prefix extends string, M extends FMSTrac
return await dispatch(_fetchPage(1))
}

const setSortBy: PagedItemsActions['setSortBy'] = (...sortByList) => async (dispatch) => {
const setSortBy: PagedItemsActions['setSortBy'] = (sortByList) => async (dispatch) => {
dispatch({
type: SET_SORT_BY,
sortByList,
Expand Down Expand Up @@ -314,7 +314,7 @@ export function createPagedItemsReducer<P extends PagedItems, Prefix extends str
return reduceClearFilters(state)
}
case SET_SORT_BY: {
return reduceSetSortBy(state, ...action.sortByList)
return reduceSetSortBy(state, action.sortByList)
}
case SET_PAGE_SIZE: {
return reduceSetPageSize(state, action.pageSize)
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/models/paged_items_reducers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export function reduceClearFilters<P extends PagedItems>(pagedItems: P): P {
}
}

export function reduceSetSortBy<P extends PagedItems>(pagedItems: P, ...sortByList: SortBy[]): P {
export function reduceSetSortBy<P extends PagedItems>(pagedItems: P, sortByList: SortBy[]): P {
return {
...pagedItems,
sortByList
Expand Down

0 comments on commit 91c922f

Please sign in to comment.