History

Remove helper any usage in auth organization sync

Rhys Sullivan committed 9 months ago

Commit 78cbbc31 parent 023aa961 file · +7 −4Browse files

Unified · Split

executor/convex/auth.ts+7−4
@@ -915,7 +915,7 @@ export const createWorkspace = mutation({ · 914 unmodified lines
915915 userId: user._id,
916916 role: user.role,
917917 status: user.status,
918− runtimeWorkspaceId: workspace.legacyWorkspaceId ?? `ws_${String(workspace._id)}`,
918+ runtimeWorkspaceId: workspace.legacyWorkspaceId ?? `ws_${workspace._id}`,
919919 };
920920 },
921921 });
@@ -934,7 +934,10 @@ export const generateWorkspaceIconUploadUrl = mutation({ · 12 unmodified lines
934934 },
935935 });
936936
937−async function resolveAccountForRequest(ctx: { auth: any; db: any }, sessionId?: string): Promise<Doc<"accounts"> | null> {
937+async function resolveAccountForRequest(
938+ ctx: Pick<MutationCtx, "auth" | "db"> | Pick<QueryCtx, "auth" | "db">,
939+ sessionId?: string,
940+): Promise<Doc<"accounts"> | null> {
938941 const identity = await ctx.auth.getUserIdentity();
939942 if (identity) {
940943 return await ctx.db
@@ -985,7 +988,7 @@ export const getMyWorkspaces = query({ · 44 unmodified lines
985988 userId: membership._id,
986989 role: membership.role,
987990 status: membership.status,
988− runtimeWorkspaceId: workspace.legacyWorkspaceId ?? `ws_${String(workspace._id)}`,
991+ runtimeWorkspaceId: workspace.legacyWorkspaceId ?? `ws_${workspace._id}`,
989992 };
990993 }),
991994 );
@@ -1020,7 +1023,7 @@ export const getMyAccountsWithWorkspaces = query({ · 28 unmodified lines
10201023 userId: membership._id,
10211024 role: membership.role,
10221025 status: membership.status,
1023− runtimeWorkspaceId: workspace.legacyWorkspaceId ?? `ws_${String(workspace._id)}`,
1026+ runtimeWorkspaceId: workspace.legacyWorkspaceId ?? `ws_${workspace._id}`,
10241027 };
10251028 }),
10261029 );