fix: reenable member invites

This commit is contained in:
Henry
2025-05-22 12:18:56 +01:00
parent 82ec18e95e
commit 71c92eea27
16 changed files with 2183 additions and 231 deletions

View File

@@ -117,8 +117,9 @@ export const workspaceRouter = createTRPCRouter({
.output(z.custom<Awaited<ReturnType<typeof workspaceRepo.create>>>())
.mutation(async ({ ctx, input }) => {
const userId = ctx.user?.id;
const userEmail = ctx.user?.email;
if (!userId)
if (!userId || !userEmail)
throw new TRPCError({
message: `User not authenticated`,
code: "UNAUTHORIZED",
@@ -131,6 +132,7 @@ export const workspaceRouter = createTRPCRouter({
name: input.name,
slug: workspacePublicId,
createdBy: userId,
createdByEmail: userEmail,
});
if (!result.publicId)