File tree Expand file tree Collapse file tree 4 files changed +18
-9
lines changed Expand file tree Collapse file tree 4 files changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -100,17 +100,19 @@ export async function fetchSubscriptionInfo() {
100
100
const planId =
101
101
tenatRes . data ?. result ?. result ?. SubscriptionDetails ?. data ?. subscription
102
102
?. subscription_id ;
103
- const plan_code =
104
- tenatRes . data ?. result ?. result ?. SubscriptionDetails ?. data ?. subscription
105
- ?. plan ?. plan_code ;
103
+ const plan_code = tenatRes . data ?. result ?. result ?. PlanCode ;
106
104
const totalAllowedUser = tenatRes . data ?. result ?. result ?. AllowedUsers || 0 ;
105
+ const adminId =
106
+ tenatRes ?. data ?. result ?. result ?. ExtUserPtr ?. objectId || "" ;
107
+
107
108
return {
108
109
status : "success" ,
109
110
price : price ,
110
111
totalPrice : totalPrice ,
111
112
planId : planId ,
112
113
plan_code : plan_code ,
113
- totalAllowedUser : totalAllowedUser
114
+ totalAllowedUser : totalAllowedUser ,
115
+ adminId : adminId
114
116
} ;
115
117
}
116
118
} catch ( err ) {
Original file line number Diff line number Diff line change @@ -135,7 +135,7 @@ const TeamList = () => {
135
135
const handleFormModal = ( ) => {
136
136
setIsModal ( ! isModal ) ;
137
137
} ;
138
- // Get current list
138
+ // to slice out 10 objects from array for current page
139
139
const indexOfLastDoc = currentPage * recordperPage ;
140
140
const indexOfFirstDoc = indexOfLastDoc - recordperPage ;
141
141
const currentList = teamList ?. slice ( indexOfFirstDoc , indexOfLastDoc ) ;
@@ -147,7 +147,8 @@ const TeamList = () => {
147
147
148
148
// Change page
149
149
const paginateFront = ( ) => {
150
- if ( currentPage < Math . max ( ...pageNumbers ) ) {
150
+ const lastValue = pageNumbers ?. [ pageNumbers ?. length - 1 ] ;
151
+ if ( currentPage < lastValue ) {
151
152
setCurrentPage ( currentPage + 1 ) ;
152
153
}
153
154
} ;
Original file line number Diff line number Diff line change @@ -85,6 +85,10 @@ const UserList = () => {
85
85
return pages ;
86
86
} ;
87
87
const pageNumbers = getPaginationRange ( ) ;
88
+ // to slice out 10 objects from array for current page
89
+ const indexOfLastDoc = currentPage * recordperPage ;
90
+ const indexOfFirstDoc = indexOfLastDoc - recordperPage ;
91
+ const currentList = userList ?. slice ( indexOfFirstDoc , indexOfLastDoc ) ;
88
92
useEffect ( ( ) => {
89
93
fetchUserList ( ) ;
90
94
// eslint-disable-next-line react-hooks/exhaustive-deps
@@ -129,7 +133,8 @@ const UserList = () => {
129
133
130
134
// Change page
131
135
const paginateFront = ( ) => {
132
- if ( currentPage < Math . max ( ...pageNumbers ) ) {
136
+ const lastValue = pageNumbers ?. [ pageNumbers ?. length - 1 ] ;
137
+ if ( currentPage < lastValue ) {
133
138
setCurrentPage ( currentPage + 1 ) ;
134
139
}
135
140
} ;
@@ -237,7 +242,7 @@ const UserList = () => {
237
242
< tbody className = "text-[12px]" >
238
243
{ userList ?. length > 0 && (
239
244
< >
240
- { userList . map ( ( item , index ) => (
245
+ { currentList . map ( ( item , index ) => (
241
246
< tr className = "border-y-[1px]" key = { index } >
242
247
{ heading . includes ( "Sr.No" ) && (
243
248
< th className = "px-4 py-2" >
Original file line number Diff line number Diff line change @@ -373,7 +373,8 @@ const ReportTable = (props) => {
373
373
374
374
// Change page
375
375
const paginateFront = ( ) => {
376
- if ( currentPage < Math . max ( ...pageNumbers ) ) {
376
+ const lastValue = pageNumbers ?. [ pageNumbers ?. length - 1 ] ;
377
+ if ( currentPage < lastValue ) {
377
378
setCurrentPage ( currentPage + 1 ) ;
378
379
}
379
380
} ;
You can’t perform that action at this time.
0 commit comments