返回 presentation-ai
clearPresentationChat.ts
根目录 / src / app / _actions / notebook / presentation / clearPresentationChat.ts
1 "use server";
2
3 import { logger } from "@/lib/observability/server/logger";
4 import { auth } from "@/server/auth";
5
6 export async function clearPresentationChat(presentationId: string) {
7 const actionName = "presentation.clearPresentationChat.clearPresentationChat";
8 const span = logger.startSpan(`notebook.server_action.${actionName}`, {
9 attributes: {
10 "allweone.scope": "notebook",
11 "allweone.action.type": "server_action",
12 "allweone.action.name": actionName,
13 },
14 });
15
16 try {
17 const session = await auth();
18 if (!session?.user) {
19 throw new Error("Unauthorized");
20 }
21
22 void presentationId;
23 return { success: true };
24 } catch (error) {
25 span.error(error);
26 throw error;
27 } finally {
28 span.end();
29 }
30 }
31
31 lines TYPESCRIPT