You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
744 B
TypeScript
29 lines
744 B
TypeScript
import type { PageContextServer } from "vike/types";
|
|
import { createCaller } from "../trpc.js";
|
|
|
|
export type Data = Awaited<ReturnType<typeof data>>;
|
|
|
|
export const data = async (pageContext: PageContextServer) => {
|
|
const { id } = pageContext.routeParams;
|
|
const caller = createCaller({});
|
|
|
|
const [
|
|
conversation,
|
|
// messages,
|
|
// facts,
|
|
// factTriggers
|
|
] = await Promise.all([
|
|
caller.conversations.fetchOne({ id }),
|
|
// caller.conversations.fetchMessages({ conversationId: id }),
|
|
// caller.facts.fetchByConversationId({ conversationId: id }),
|
|
// caller.factTriggers.fetchByConversationId({ conversationId: id }),
|
|
]);
|
|
|
|
return {
|
|
conversation,
|
|
// messages,
|
|
// facts,
|
|
// factTriggers
|
|
};
|
|
};
|