0.6 rust重构01

This commit is contained in:
lix-2026
2026-04-14 13:22:29 +08:00
parent 71fb1aee7e
commit 84a8454fa9
401 changed files with 5841 additions and 1512 deletions
+1 -9
View File
@@ -1,6 +1,6 @@
import { mutation, query } from "./_generated/server";
import { v } from "convex/values";
import { getAuthUserId } from "@convex-dev/auth/server";
import { requireUserId } from "./_utils/auth";
import { nowIso } from "./_utils/time";
import type { MutationCtx, QueryCtx } from "./_generated/server";
@@ -13,14 +13,6 @@ type WorkspaceSummary = {
isDefault: boolean;
};
async function requireUserId(ctx: any): Promise<string> {
const userId = await getAuthUserId(ctx);
if (userId === null) {
throw new Error("未登录");
}
return userId;
}
async function findWorkspaceById(ctx: QueryCtx | MutationCtx, workspaceId: string) {
return await ctx.db
.query("workspaces")