mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-17 14:27:02 +08:00
@@ -88,7 +88,7 @@ export const CloudWorkspaceMembersPanel = ({
|
||||
|
||||
const onGenerateInviteLink = useCallback(
|
||||
async (expireTime: WorkspaceInviteLinkExpireTime) => {
|
||||
const link =
|
||||
const { link } =
|
||||
await permissionService.permission.generateInviteLink(expireTime);
|
||||
return link;
|
||||
},
|
||||
|
||||
@@ -16,10 +16,7 @@ export class WorkspacePermissionService extends Service {
|
||||
}
|
||||
|
||||
async leaveWorkspace() {
|
||||
await this.store.leaveWorkspace(
|
||||
this.workspaceService.workspace.id,
|
||||
this.workspaceService.workspace.name$.value ?? ''
|
||||
);
|
||||
await this.store.leaveWorkspace(this.workspaceService.workspace.id);
|
||||
this.workspacesService.list.revalidate();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ export class WorkspacePermissionStore extends Store {
|
||||
/**
|
||||
* @param workspaceName for send email
|
||||
*/
|
||||
async leaveWorkspace(workspaceId: string, workspaceName: string) {
|
||||
async leaveWorkspace(workspaceId: string) {
|
||||
if (!this.workspaceServerService.server) {
|
||||
throw new Error('No Server');
|
||||
}
|
||||
@@ -188,7 +188,6 @@ export class WorkspacePermissionStore extends Store {
|
||||
query: leaveWorkspaceMutation,
|
||||
variables: {
|
||||
workspaceId,
|
||||
workspaceName,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -840,12 +840,8 @@ export const leaveWorkspaceMutation = {
|
||||
definitionName: 'leaveWorkspace',
|
||||
containsFile: false,
|
||||
query: `
|
||||
mutation leaveWorkspace($workspaceId: String!, $workspaceName: String!, $sendLeaveMail: Boolean) {
|
||||
leaveWorkspace(
|
||||
workspaceId: $workspaceId
|
||||
workspaceName: $workspaceName
|
||||
sendLeaveMail: $sendLeaveMail
|
||||
)
|
||||
mutation leaveWorkspace($workspaceId: String!, $sendLeaveMail: Boolean) {
|
||||
leaveWorkspace(workspaceId: $workspaceId, sendLeaveMail: $sendLeaveMail)
|
||||
}`,
|
||||
};
|
||||
|
||||
@@ -1442,7 +1438,10 @@ export const createInviteLinkMutation = {
|
||||
containsFile: false,
|
||||
query: `
|
||||
mutation createInviteLink($workspaceId: String!, $expireTime: WorkspaceInviteLinkExpireTime!) {
|
||||
createInviteLink(workspaceId: $workspaceId, expireTime: $expireTime)
|
||||
createInviteLink(workspaceId: $workspaceId, expireTime: $expireTime) {
|
||||
link
|
||||
expireTime
|
||||
}
|
||||
}`,
|
||||
};
|
||||
|
||||
|
||||
@@ -1,11 +1,3 @@
|
||||
mutation leaveWorkspace(
|
||||
$workspaceId: String!
|
||||
$workspaceName: String!
|
||||
$sendLeaveMail: Boolean
|
||||
) {
|
||||
leaveWorkspace(
|
||||
workspaceId: $workspaceId
|
||||
workspaceName: $workspaceName
|
||||
sendLeaveMail: $sendLeaveMail
|
||||
)
|
||||
mutation leaveWorkspace($workspaceId: String!, $sendLeaveMail: Boolean) {
|
||||
leaveWorkspace(workspaceId: $workspaceId, sendLeaveMail: $sendLeaveMail)
|
||||
}
|
||||
|
||||
@@ -2,5 +2,8 @@ mutation createInviteLink(
|
||||
$workspaceId: String!
|
||||
$expireTime: WorkspaceInviteLinkExpireTime!
|
||||
) {
|
||||
createInviteLink(workspaceId: $workspaceId, expireTime: $expireTime)
|
||||
createInviteLink(workspaceId: $workspaceId, expireTime: $expireTime) {
|
||||
link
|
||||
expireTime
|
||||
}
|
||||
}
|
||||
|
||||
@@ -567,7 +567,7 @@ export interface Mutation {
|
||||
createCopilotSession: Scalars['String']['output'];
|
||||
/** Create a stripe customer portal to manage payment methods */
|
||||
createCustomerPortal: Scalars['String']['output'];
|
||||
createInviteLink: Scalars['String']['output'];
|
||||
createInviteLink: InviteLink;
|
||||
/** Create a new user */
|
||||
createUser: UserType;
|
||||
/** Create a new workspace */
|
||||
@@ -735,7 +735,7 @@ export interface MutationInviteBatchArgs {
|
||||
export interface MutationLeaveWorkspaceArgs {
|
||||
sendLeaveMail?: InputMaybe<Scalars['Boolean']['input']>;
|
||||
workspaceId: Scalars['String']['input'];
|
||||
workspaceName: Scalars['String']['input'];
|
||||
workspaceName?: InputMaybe<Scalars['String']['input']>;
|
||||
}
|
||||
|
||||
export interface MutationPublishPageArgs {
|
||||
@@ -2163,7 +2163,6 @@ export type InvoicesQuery = {
|
||||
|
||||
export type LeaveWorkspaceMutationVariables = Exact<{
|
||||
workspaceId: Scalars['String']['input'];
|
||||
workspaceName: Scalars['String']['input'];
|
||||
sendLeaveMail?: InputMaybe<Scalars['Boolean']['input']>;
|
||||
}>;
|
||||
|
||||
@@ -2692,7 +2691,11 @@ export type CreateInviteLinkMutationVariables = Exact<{
|
||||
|
||||
export type CreateInviteLinkMutation = {
|
||||
__typename?: 'Mutation';
|
||||
createInviteLink: string;
|
||||
createInviteLink: {
|
||||
__typename?: 'InviteLink';
|
||||
link: string;
|
||||
expireTime: string;
|
||||
};
|
||||
};
|
||||
|
||||
export type RevokeInviteLinkMutationVariables = Exact<{
|
||||
|
||||
Reference in New Issue
Block a user