Skip to content

Commit

Permalink
fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
ArturBekhDEV committed Sep 19, 2023
1 parent 2191421 commit 2f1c960
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import useSort from '~/hooks/table/use-sort'
import useBreakpoints from '~/hooks/use-breakpoints'
import useAxios from '~/hooks/use-axios'
import { authRoutes } from '~/router/constants/authRoutes'
import usePagination from '~/hooks/table/use-pagination'

import { defaultResponses, snackbarVariants } from '~/constants'
import {
Expand All @@ -32,6 +33,7 @@ const QuestionsContainer = () => {
const sortOptions = useSort({ initialSort })
const searchTitle = useRef<string>('')
const breakpoints = useBreakpoints()
const { page, handleChangePage } = usePagination()

const { sort } = sortOptions
const itemsPerPage = getScreenBasedLimit(breakpoints, itemsLoadLimit)
Expand All @@ -56,9 +58,10 @@ const QuestionsContainer = () => {
ResourceService.getQuestions({
limit: itemsPerPage,
sort,
title: searchTitle.current
title: searchTitle.current,
skip: (page - 1) * itemsPerPage
}),
[itemsPerPage, sort]
[itemsPerPage, sort, page]
)

const { response, loading, fetchData } = useAxios<
Expand All @@ -78,7 +81,7 @@ const QuestionsContainer = () => {
actions: { onEdit: () => null },
resource: ResourcesTabsEnum.Questions,
sort: sortOptions,
pagination: { page: 1, onChange: () => null }
pagination: { page, onChange: handleChangePage }
}

return (
Expand Down

0 comments on commit 2f1c960

Please sign in to comment.