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
@@ -1,5 +1,9 @@
import { NextResponse } from "next/server";
import { createSupabaseRouteClient } from "@/lib/supabase/server";
import { isConvexEnabled } from "@/lib/convex/enabled";
import { getConvexHttpClient } from "@/lib/convex/server";
import { api } from "@/lib/convex/api";
import { requireAuthContext } from "@/lib/auth/authContext";
interface RenamePayload {
documentId: string;
@@ -7,6 +11,18 @@ interface RenamePayload {
}
export async function POST(request: Request) {
if (isConvexEnabled()) {
const auth = requireAuthContext();
const { documentId, title }: RenamePayload = await request.json();
const client = getConvexHttpClient();
await client.mutation(api.documents.updateTitle, {
userId: auth.userId,
id: documentId,
title,
});
return NextResponse.json({ ok: true });
}
const supabase = await createSupabaseRouteClient();
const {
data: { session },