refactor: update to use organization resources

This commit is contained in:
Mauricio Siu
2025-02-15 20:43:23 -06:00
parent 6d0e195a4d
commit e3e35ce792
24 changed files with 348 additions and 178 deletions

View File

@@ -32,7 +32,7 @@ import { ZodError } from "zod";
interface CreateContextOptions {
user: (User & { rol: "member" | "admin" | "owner"; ownerId: string }) | null;
session: (Session & { activeOrganizationId?: string }) | null;
session: (Session & { activeOrganizationId: string }) | null;
req: CreateNextContextOptions["req"];
res: CreateNextContextOptions["res"];
}
@@ -84,7 +84,7 @@ export const createTRPCContext = async (opts: CreateNextContextOptions) => {
session: session
? {
...session,
activeOrganizationId: session.activeOrganizationId ?? undefined,
activeOrganizationId: session.activeOrganizationId || "",
}
: null,
user: user