双向删除同步

This commit is contained in:
liaibo
2026-01-02 07:25:50 +08:00
parent 1db64c1c55
commit b1288487af
48 changed files with 2406 additions and 8841 deletions
@@ -3,9 +3,9 @@ import { createSupabaseRouteClient } from "@/lib/supabase/server";
import type { DocumentTableSnapshot, TableRowData } from "@/types/online-table";
interface RouteContext {
params: {
params: Promise<{
tableId: string;
};
}>;
}
type UpdateTableRequest = {
@@ -19,9 +19,7 @@ type UpdateTableRequest = {
};
const extractTableId = async (context: RouteContext) => {
// Next.js 16 / Turbopack 下 params 是 Promise,需要等待。
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return (await (context as any).params).tableId as string;
return (await context.params).tableId;
};
const getAuthUser = async () => {
@@ -31,7 +29,7 @@ const getAuthUser = async () => {
console.error("Auth getUser error:", error);
}
if (!data?.user) {
return { supabase, user: null as const };
return { supabase, user: null };
}
return { supabase, user: data.user };
};