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.
17 lines
480 B
TypeScript
17 lines
480 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 = await caller.fetchConversation({
|
|
id,
|
|
});
|
|
const messages = await caller.fetchMessages({
|
|
conversationId: id,
|
|
});
|
|
return { conversation, messages };
|
|
};
|