mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-25 06:18:45 +08:00
feat(server): delay subscription after invitation accepted or approved (#11992)
This commit is contained in:
@@ -1,33 +1,33 @@
|
||||
import type { InvitationType } from '../../core/workspaces';
|
||||
import type { TestingApp } from './testing-app';
|
||||
|
||||
export async function inviteUser(
|
||||
app: TestingApp,
|
||||
workspaceId: string,
|
||||
email: string,
|
||||
sendInviteMail = false
|
||||
email: string
|
||||
): Promise<string> {
|
||||
const res = await app.gql(`
|
||||
mutation {
|
||||
invite(workspaceId: "${workspaceId}", email: "${email}", sendInviteMail: ${sendInviteMail})
|
||||
inviteMembers(workspaceId: "${workspaceId}", emails: ["${email}"]) {
|
||||
inviteId
|
||||
}
|
||||
}
|
||||
`);
|
||||
|
||||
return res.invite;
|
||||
return res.inviteMembers[0].inviteId;
|
||||
}
|
||||
|
||||
export async function inviteUsers(
|
||||
app: TestingApp,
|
||||
workspaceId: string,
|
||||
emails: string[],
|
||||
sendInviteMail = false
|
||||
emails: string[]
|
||||
): Promise<Array<{ email: string; inviteId?: string; sentSuccess?: boolean }>> {
|
||||
const res = await app.gql(
|
||||
`
|
||||
mutation inviteBatch($workspaceId: String!, $emails: [String!]!, $sendInviteMail: Boolean) {
|
||||
inviteBatch(
|
||||
mutation inviteMembers($workspaceId: String!, $emails: [String!]!) {
|
||||
inviteMembers(
|
||||
workspaceId: $workspaceId
|
||||
emails: $emails
|
||||
sendInviteMail: $sendInviteMail
|
||||
) {
|
||||
email
|
||||
inviteId
|
||||
@@ -35,10 +35,10 @@ export async function inviteUsers(
|
||||
}
|
||||
}
|
||||
`,
|
||||
{ workspaceId, emails, sendInviteMail }
|
||||
{ workspaceId, emails }
|
||||
);
|
||||
|
||||
return res.inviteBatch;
|
||||
return res.inviteMembers;
|
||||
}
|
||||
|
||||
export async function getInviteLink(
|
||||
|
||||
Reference in New Issue
Block a user