Skip to content

Commit

Permalink
Sender med page i stedet for offset
Browse files Browse the repository at this point in the history
  • Loading branch information
matsbyfl committed Dec 13, 2024
1 parent 4719ad8 commit 5219395
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion client/src/oppgavebenk/Oppgavebenk.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ export function Oppgavebenk() {

const [sort, setSort] = useLocalStorageState<SortState>('oppgavebenkSortState', initialSortState)

const { oppgaver, isLoading, error, totalElements } = useOppgavelisteV2(1, sort, { tildeltFilter, gjelderFilter })
const { oppgaver, isLoading, error, totalElements } = useOppgavelisteV2(currentPage, sort, {
tildeltFilter,
gjelderFilter,
})

const handleFilter = (handler: (...args: any[]) => any, value: OppgaveGjelderFilter | string) => {
handler(value)
Expand Down
2 changes: 1 addition & 1 deletion client/src/oppgavebenk/useOppgavelisteV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ interface Filters {

const pathConfig = (currentPage: number, sort: SortState, filters: Filters): PathConfigType => {
const sortDirection = sort.direction === 'ascending' ? 'ASC' : 'DESC'
const pagingParams = { limit: PAGE_SIZE, offset: currentPage - 1 }
const pagingParams = { limit: PAGE_SIZE, page: currentPage }
const sortParams = { sorteringsfelt: sort.orderBy, sorteringsrekkefølge: sortDirection }
const { tildeltFilter, gjelderFilter } = filters

Expand Down

0 comments on commit 5219395

Please sign in to comment.