@@ -37,7 +37,7 @@ export default function Home() {
37
37
const [ totalCount , setTotalCount ] = useState < number | undefined > ( undefined ) ; // Store the total count of questions
38
38
const [ totalPages , setTotalPages ] = useState < number | undefined > ( undefined ) ; // Store the total number of pages
39
39
const [ currentPage , setCurrentPage ] = useState < number | undefined > ( undefined ) ; // Store the current page
40
- const [ limit , setLimit ] = useState < number | undefined > ( undefined ) ; // Store the quantity of questions to be displayed
40
+ const [ limit , setLimit ] = useState < number | undefined > ( 10 ) ; // Store the quantity of questions to be displayed
41
41
const [ isLoading , setIsLoading ] = useState < boolean > ( true ) ; // Store the states related to table's loading
42
42
43
43
// Filtering States
@@ -78,15 +78,15 @@ export default function Home() {
78
78
setIsLoading ( true ) ;
79
79
}
80
80
81
- GetQuestions ( ) . then ( ( data ) => {
81
+ GetQuestions ( currentPage , limit ) . then ( ( data ) => {
82
82
setQuestions ( data . questions ) ;
83
83
setTotalCount ( data . totalCount ) ;
84
84
setTotalPages ( data . totalPages ) ;
85
85
setCurrentPage ( data . currentPage ) ;
86
86
setLimit ( data . limit ) ;
87
87
setIsLoading ( false ) ;
88
88
} ) ;
89
- } , [ ] ) ;
89
+ } , [ limit , currentPage ] ) ;
90
90
91
91
// Table column specification
92
92
const columns : TableProps < Question > [ "columns" ] = [
@@ -167,6 +167,8 @@ export default function Home() {
167
167
current ,
168
168
pageSize
169
169
) => {
170
+ console . log ( current ) ;
171
+ console . log ( pageSize ) ;
170
172
setCurrentPage ( current ) ;
171
173
setLimit ( pageSize ) ;
172
174
} ;
@@ -256,7 +258,7 @@ export default function Home() {
256
258
total : totalCount ,
257
259
showSizeChanger : true ,
258
260
onShowSizeChange : onShowSizeChange ,
259
- showQuickJumper : true ,
261
+ // showQuickJumper: true,
260
262
onChange : onPageJump ,
261
263
} }
262
264
/>
0 commit comments