File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
components/dashboard/src/admin Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -22,9 +22,10 @@ export default function UserSearch() {
22
22
const [ currentUser , setCurrentUserState ] = useState < User | undefined > ( undefined ) ;
23
23
const pageLength = 50 ;
24
24
const [ currentPage , setCurrentPage ] = useState ( 1 ) ;
25
- useEffect ( ( ) => {
25
+ const updateCurrentPage = ( page : number ) => {
26
+ setCurrentPage ( page ) ;
26
27
search ( ) ;
27
- } , [ currentPage ] ) ;
28
+ } ;
28
29
29
30
useEffect ( ( ) => {
30
31
const userId = location . pathname . split ( "/" ) [ 3 ] ;
@@ -111,7 +112,7 @@ export default function UserSearch() {
111
112
</ div >
112
113
< Pagination
113
114
currentPage = { currentPage }
114
- setPage = { setCurrentPage }
115
+ setPage = { updateCurrentPage }
115
116
totalNumberOfPages = { Math . ceil ( searchResult . total / pageLength ) }
116
117
/>
117
118
</ PageWithAdminSubMenu >
You can’t perform that action at this time.
0 commit comments