mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
feat(admin): add ban user to admin panel (#10780)
This commit is contained in:
6
packages/frontend/graphql/src/graphql/disable-user.gql
Normal file
6
packages/frontend/graphql/src/graphql/disable-user.gql
Normal file
@@ -0,0 +1,6 @@
|
||||
mutation disableUser($id: String!) {
|
||||
banUser(id: $id) {
|
||||
email
|
||||
disabled
|
||||
}
|
||||
}
|
||||
6
packages/frontend/graphql/src/graphql/enable-user.gql
Normal file
6
packages/frontend/graphql/src/graphql/enable-user.gql
Normal file
@@ -0,0 +1,6 @@
|
||||
mutation enableUser($id: String!) {
|
||||
enableUser(id: $id) {
|
||||
email
|
||||
disabled
|
||||
}
|
||||
}
|
||||
@@ -439,6 +439,17 @@ export const deleteWorkspaceMutation = {
|
||||
}`,
|
||||
};
|
||||
|
||||
export const disableUserMutation = {
|
||||
id: 'disableUserMutation' as const,
|
||||
op: 'disableUser',
|
||||
query: `mutation disableUser($id: String!) {
|
||||
banUser(id: $id) {
|
||||
email
|
||||
disabled
|
||||
}
|
||||
}`,
|
||||
};
|
||||
|
||||
export const getDocRolePermissionsQuery = {
|
||||
id: 'getDocRolePermissionsQuery' as const,
|
||||
op: 'getDocRolePermissions',
|
||||
@@ -465,6 +476,17 @@ export const getDocRolePermissionsQuery = {
|
||||
}`,
|
||||
};
|
||||
|
||||
export const enableUserMutation = {
|
||||
id: 'enableUserMutation' as const,
|
||||
op: 'enableUser',
|
||||
query: `mutation enableUser($id: String!) {
|
||||
enableUser(id: $id) {
|
||||
email
|
||||
disabled
|
||||
}
|
||||
}`,
|
||||
};
|
||||
|
||||
export const generateLicenseKeyMutation = {
|
||||
id: 'generateLicenseKeyMutation' as const,
|
||||
op: 'generateLicenseKey',
|
||||
@@ -970,6 +992,7 @@ export const listUsersQuery = {
|
||||
id
|
||||
name
|
||||
email
|
||||
disabled
|
||||
features
|
||||
hasPassword
|
||||
emailVerified
|
||||
|
||||
@@ -3,6 +3,7 @@ query listUsers($filter: ListUserInput!) {
|
||||
id
|
||||
name
|
||||
email
|
||||
disabled
|
||||
features
|
||||
hasPassword
|
||||
emailVerified
|
||||
|
||||
@@ -2597,6 +2597,15 @@ export type DeleteWorkspaceMutation = {
|
||||
deleteWorkspace: boolean;
|
||||
};
|
||||
|
||||
export type DisableUserMutationVariables = Exact<{
|
||||
id: Scalars['String']['input'];
|
||||
}>;
|
||||
|
||||
export type DisableUserMutation = {
|
||||
__typename?: 'Mutation';
|
||||
banUser: { __typename?: 'UserType'; email: string; disabled: boolean };
|
||||
};
|
||||
|
||||
export type GetDocRolePermissionsQueryVariables = Exact<{
|
||||
workspaceId: Scalars['String']['input'];
|
||||
docId: Scalars['String']['input'];
|
||||
@@ -2628,6 +2637,15 @@ export type GetDocRolePermissionsQuery = {
|
||||
};
|
||||
};
|
||||
|
||||
export type EnableUserMutationVariables = Exact<{
|
||||
id: Scalars['String']['input'];
|
||||
}>;
|
||||
|
||||
export type EnableUserMutation = {
|
||||
__typename?: 'Mutation';
|
||||
enableUser: { __typename?: 'UserType'; email: string; disabled: boolean };
|
||||
};
|
||||
|
||||
export type CredentialsRequirementsFragment = {
|
||||
__typename?: 'CredentialsRequirementType';
|
||||
password: {
|
||||
@@ -3195,6 +3213,7 @@ export type ListUsersQuery = {
|
||||
id: string;
|
||||
name: string;
|
||||
email: string;
|
||||
disabled: boolean;
|
||||
features: Array<FeatureType>;
|
||||
hasPassword: boolean | null;
|
||||
emailVerified: boolean;
|
||||
@@ -4152,6 +4171,16 @@ export type Mutations =
|
||||
variables: DeleteWorkspaceMutationVariables;
|
||||
response: DeleteWorkspaceMutation;
|
||||
}
|
||||
| {
|
||||
name: 'disableUserMutation';
|
||||
variables: DisableUserMutationVariables;
|
||||
response: DisableUserMutation;
|
||||
}
|
||||
| {
|
||||
name: 'enableUserMutation';
|
||||
variables: EnableUserMutationVariables;
|
||||
response: EnableUserMutation;
|
||||
}
|
||||
| {
|
||||
name: 'generateLicenseKeyMutation';
|
||||
variables: GenerateLicenseKeyMutationVariables;
|
||||
|
||||
Reference in New Issue
Block a user