双向删除同步
This commit is contained in:
@@ -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 };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user