🔧 fix(AdminPage/index.tsx): fix incorrect assignment of users and total count in getUsersPage response
🔧 fix(AdminPage/index.tsx): fix incorrect assignment of filtered user list in getUsersPage response 🔧 fix(AdminPage/index.tsx): fix incorrect assignment of total rows count in getUsersPage response
This commit is contained in:
parent
e124b216d7
commit
b96fcfb06c
1 changed files with 4 additions and 2 deletions
|
|
@ -33,6 +33,7 @@ export default function AdminPage() {
|
||||||
const [loadingUsers, setLoadingUsers] = useState(true);
|
const [loadingUsers, setLoadingUsers] = useState(true);
|
||||||
const { setErrorData, setSuccessData } = useContext(alertContext);
|
const { setErrorData, setSuccessData } = useContext(alertContext);
|
||||||
const { userData } = useContext(AuthContext);
|
const { userData } = useContext(AuthContext);
|
||||||
|
const [totalRowsCount, setTotalRowsCount] = useState(0);
|
||||||
|
|
||||||
const userList = useRef([]);
|
const userList = useRef([]);
|
||||||
|
|
||||||
|
|
@ -48,8 +49,9 @@ export default function AdminPage() {
|
||||||
setLoadingUsers(true);
|
setLoadingUsers(true);
|
||||||
getUsersPage(index, size)
|
getUsersPage(index, size)
|
||||||
.then((users) => {
|
.then((users) => {
|
||||||
userList.current = users;
|
setTotalRowsCount(users['total_count']);
|
||||||
setFilterUserList(users);
|
userList.current = users['users'];
|
||||||
|
setFilterUserList(users['users']);
|
||||||
setLoadingUsers(false);
|
setLoadingUsers(false);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue