refactor trpc procedures into domains
This commit is contained in:
@@ -76,7 +76,7 @@ export default function ChatPage() {
|
||||
|
||||
async function handleDeleteFact(factId: string) {
|
||||
removeFact(factId);
|
||||
await trpc.chat.deleteFact.mutate({ factId });
|
||||
await trpc.chat.facts.deleteOne.mutate({ factId });
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -90,7 +90,7 @@ export default function ChatPage() {
|
||||
setConversationTitle(e.target.value);
|
||||
}}
|
||||
onBlur={(e) => {
|
||||
trpc.chat.updateConversationTitle.mutate({
|
||||
trpc.chat.conversations.updateTitle.mutate({
|
||||
id: conversationId,
|
||||
title: e.target.value,
|
||||
});
|
||||
|
||||
@@ -6,13 +6,13 @@ 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({
|
||||
const conversation = await caller.conversations.fetchOne({
|
||||
id,
|
||||
});
|
||||
const messages = await caller.fetchMessages({
|
||||
const messages = await caller.conversations.fetchMessages({
|
||||
conversationId: id,
|
||||
});
|
||||
const facts = await caller.fetchFacts({
|
||||
const facts = await caller.facts.fetchByConversationId({
|
||||
conversationId: id,
|
||||
});
|
||||
return { conversation, messages, facts };
|
||||
|
||||
Reference in New Issue
Block a user