fix: allow member invites when signup is disabled (#121)

This commit is contained in:
Henry
2025-07-20 11:18:19 +01:00
committed by GitHub
parent 1305c55100
commit 0cb69e2087
2 changed files with 26 additions and 2 deletions

View File

@@ -41,6 +41,20 @@ export const getByPublicId = async (db: dbClient, publicId: string) => {
});
};
export const getByEmailAndStatus = async (
db: dbClient,
email: string,
status: MemberStatus,
) => {
return db.query.workspaceMembers.findFirst({
where: and(
eq(workspaceMembers.email, email),
eq(workspaceMembers.status, status),
isNull(workspaceMembers.deletedAt),
),
});
};
export const acceptInvite = async (
db: dbClient,
args: { memberId: number; userId: string },