mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-18 23:07:02 +08:00
fix(admin): user count is out of sync and search results are not cached in account management (#11980)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Improved user management table with dynamic row count updates and enhanced synchronization of memoized user lists. - **Bug Fixes** - User count and displayed data now update immediately after user creation, deletion, or import, ensuring accurate and consistent information. - **Chores** - Enhanced internal state management for better responsiveness and reliability in the accounts section. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
query getUsersCount {
|
||||
usersCount
|
||||
}
|
||||
@@ -9,4 +9,5 @@ query listUsers($filter: ListUserInput!) {
|
||||
emailVerified
|
||||
avatarUrl
|
||||
}
|
||||
usersCount
|
||||
}
|
||||
|
||||
@@ -171,14 +171,6 @@ export const getUserByEmailQuery = {
|
||||
}`,
|
||||
};
|
||||
|
||||
export const getUsersCountQuery = {
|
||||
id: 'getUsersCountQuery' as const,
|
||||
op: 'getUsersCount',
|
||||
query: `query getUsersCount {
|
||||
usersCount
|
||||
}`,
|
||||
};
|
||||
|
||||
export const importUsersMutation = {
|
||||
id: 'importUsersMutation' as const,
|
||||
op: 'ImportUsers',
|
||||
@@ -212,6 +204,7 @@ export const listUsersQuery = {
|
||||
emailVerified
|
||||
avatarUrl
|
||||
}
|
||||
usersCount
|
||||
}`,
|
||||
};
|
||||
|
||||
|
||||
@@ -2811,10 +2811,6 @@ export type GetUserByEmailQuery = {
|
||||
} | null;
|
||||
};
|
||||
|
||||
export type GetUsersCountQueryVariables = Exact<{ [key: string]: never }>;
|
||||
|
||||
export type GetUsersCountQuery = { __typename?: 'Query'; usersCount: number };
|
||||
|
||||
export type ImportUsersMutationVariables = Exact<{
|
||||
input: ImportUsersInput;
|
||||
}>;
|
||||
@@ -2833,6 +2829,7 @@ export type ListUsersQueryVariables = Exact<{
|
||||
|
||||
export type ListUsersQuery = {
|
||||
__typename?: 'Query';
|
||||
usersCount: number;
|
||||
users: Array<{
|
||||
__typename?: 'UserType';
|
||||
id: string;
|
||||
@@ -4969,11 +4966,6 @@ export type Queries =
|
||||
variables: GetUserByEmailQueryVariables;
|
||||
response: GetUserByEmailQuery;
|
||||
}
|
||||
| {
|
||||
name: 'getUsersCountQuery';
|
||||
variables: GetUsersCountQueryVariables;
|
||||
response: GetUsersCountQuery;
|
||||
}
|
||||
| {
|
||||
name: 'listUsersQuery';
|
||||
variables: ListUsersQueryVariables;
|
||||
|
||||
Reference in New Issue
Block a user