File tree 4 files changed +16
-12
lines changed
components/dashboard/src/admin
4 files changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -32,9 +32,10 @@ export function ProjectsSearch() {
32
32
const [ currentProjectOwner , setCurrentProjectOwner ] = useState < string | undefined > ( "" ) ;
33
33
const pageLength = 50 ;
34
34
const [ currentPage , setCurrentPage ] = useState ( 1 ) ;
35
- useEffect ( ( ) => {
35
+ const updateCurrentPage = ( page : number ) => {
36
+ setCurrentPage ( page ) ;
36
37
search ( ) ;
37
- } , [ currentPage ] ) ;
38
+ } ;
38
39
39
40
useEffect ( ( ) => {
40
41
const projectId = location . pathname . split ( "/" ) [ 3 ] ;
@@ -139,7 +140,7 @@ export function ProjectsSearch() {
139
140
</ div >
140
141
< Pagination
141
142
currentPage = { currentPage }
142
- setPage = { setCurrentPage }
143
+ setPage = { updateCurrentPage }
143
144
totalNumberOfPages = { Math . ceil ( searchResult . total / pageLength ) }
144
145
/>
145
146
</ >
Original file line number Diff line number Diff line change @@ -32,9 +32,10 @@ export function TeamsSearch() {
32
32
const [ searchResult , setSearchResult ] = useState < AdminGetListResult < Team > > ( { total : 0 , rows : [ ] } ) ;
33
33
const pageLength = 50 ;
34
34
const [ currentPage , setCurrentPage ] = useState ( 1 ) ;
35
- useEffect ( ( ) => {
35
+ const updateCurrentPage = ( page : number ) => {
36
+ setCurrentPage ( page ) ;
36
37
search ( ) ;
37
- } , [ currentPage ] ) ;
38
+ } ;
38
39
39
40
useEffect ( ( ) => {
40
41
const teamId = location . pathname . split ( "/" ) [ 3 ] ;
@@ -128,7 +129,7 @@ export function TeamsSearch() {
128
129
</ div >
129
130
< Pagination
130
131
currentPage = { currentPage }
131
- setPage = { setCurrentPage }
132
+ setPage = { updateCurrentPage }
132
133
totalNumberOfPages = { Math . ceil ( searchResult . total / pageLength ) }
133
134
/>
134
135
</ >
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 >
Original file line number Diff line number Diff line change @@ -47,9 +47,10 @@ export function WorkspaceSearch(props: Props) {
47
47
const [ currentWorkspace , setCurrentWorkspaceState ] = useState < WorkspaceAndInstance | undefined > ( undefined ) ;
48
48
const pageLength = 50 ;
49
49
const [ currentPage , setCurrentPage ] = useState ( 1 ) ;
50
- useEffect ( ( ) => {
50
+ const updateCurrentPage = ( page : number ) => {
51
+ setCurrentPage ( page ) ;
51
52
search ( ) ;
52
- } , [ currentPage ] ) ;
53
+ } ;
53
54
54
55
useEffect ( ( ) => {
55
56
const workspaceId = location . pathname . split ( "/" ) [ 3 ] ;
@@ -161,7 +162,7 @@ export function WorkspaceSearch(props: Props) {
161
162
</ div >
162
163
< Pagination
163
164
currentPage = { currentPage }
164
- setPage = { setCurrentPage }
165
+ setPage = { updateCurrentPage }
165
166
totalNumberOfPages = { Math . ceil ( searchResult . total / pageLength ) }
166
167
/>
167
168
</ >
You can’t perform that action at this time.
0 commit comments