mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-07 01:09:54 +08:00
fix(admin): frequent query requests in the search (#7854)
This commit is contained in:
@@ -3,10 +3,12 @@ import {
|
||||
useMutateQueryResource,
|
||||
useMutation,
|
||||
} from '@affine/core/hooks/use-mutation';
|
||||
import { useQuery } from '@affine/core/hooks/use-query';
|
||||
import {
|
||||
createChangePasswordUrlMutation,
|
||||
createUserMutation,
|
||||
deleteUserMutation,
|
||||
getUsersCountQuery,
|
||||
listUsersQuery,
|
||||
updateAccountFeaturesMutation,
|
||||
updateAccountMutation,
|
||||
@@ -159,3 +161,12 @@ export const useDeleteUser = () => {
|
||||
|
||||
return deleteById;
|
||||
};
|
||||
|
||||
export const useUserCount = () => {
|
||||
const {
|
||||
data: { usersCount },
|
||||
} = useQuery({
|
||||
query: getUsersCountQuery,
|
||||
});
|
||||
return usersCount;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user