0.2.1 onlyoffice修复

This commit is contained in:
liaibo
2026-01-17 10:12:53 +08:00
parent 94957dc361
commit 19907bccdc
102 changed files with 7188 additions and 186 deletions
@@ -3,6 +3,9 @@ import { createSupabaseRouteClient } from "@/lib/supabase/server";
import { promises as fs } from "fs";
import path from "path";
import { getDocumentsBaseDir, getLegacyMindmapsBaseDir } from "@/lib/server/local-paths";
import { isConvexEnabled } from "@/lib/convex/enabled";
import { getAuthedConvexClient } from "@/lib/convex/route";
import { api } from "@/lib/convex/api";
export const dynamic = "force-dynamic";
@@ -29,6 +32,24 @@ async function purgeTrashFolder(folder: string): Promise<number> {
}
export async function POST(request: Request) {
if (isConvexEnabled()) {
const { auth, client } = getAuthedConvexClient();
const { workspaceId }: EmptyTrashPayload = await request.json().catch(() => ({}));
if (!workspaceId) {
return NextResponse.json({ error: "缺少 workspaceId" }, { status: 400 });
}
try {
const result = await client.mutation(api.mindmaps.emptyTrashByWorkspace, {
userId: auth.userId,
workspaceId,
});
return NextResponse.json({ ok: true, removed: result?.deletedCount ?? 0 });
} catch (error) {
return NextResponse.json({ error: (error as Error).message }, { status: 400 });
}
}
const supabase = await createSupabaseRouteClient();
const {
data: { session },