Skip to content

Commit

Permalink
fix(ui): tasks sort order (#423)
Browse files Browse the repository at this point in the history
  • Loading branch information
bouassaba authored Dec 7, 2024
1 parent 4bfd307 commit ca380e9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ui/src/components/task/task-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
usePageMonitor,
} from '@koupr/ui'
import cx from 'classnames'
import TaskAPI, { SortOrder } from '@/client/api/task'
import TaskAPI, { SortBy, SortOrder } from '@/client/api/task'
import { errorToString } from '@/client/error'
import { swrConfig } from '@/client/options'
import { useAppDispatch } from '@/store/hook'
Expand All @@ -32,7 +32,10 @@ const TasksList = () => {
error: listError,
isLoading: listIsLoading,
mutate: mutateList,
} = TaskAPI.useList({ page, size, sortOrder: SortOrder.Asc }, swrConfig())
} = TaskAPI.useList(
{ page, size, sortOrder: SortOrder.Desc, sortBy: SortBy.DateCreated },
swrConfig(),
)
const { hasPageSwitcher } = usePageMonitor({
totalPages: list?.totalPages ?? 1,
totalElements: list?.totalElements ?? 0,
Expand Down

0 comments on commit ca380e9

Please sign in to comment.