Skip to content

Commit b5eff88

Browse files
committed
Remove dummy chat history fallback
1 parent 0e2b2ac commit b5eff88

1 file changed

Lines changed: 8 additions & 15 deletions

File tree

chatapi/src/utils/db.utils.ts

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,14 @@ import { ChatMessage } from '../models/chat.model';
88
* @returns Array of chat conversations
99
*/
1010
async function getChatDocument(id: string) {
11-
try {
12-
const res = await chatDB.get(id) as DbDoc;
13-
return {
14-
'conversations': res.conversations,
15-
'title': res.title,
16-
'createdDate': res.createdDate,
17-
'aiProvider': res.aiProvider
18-
};
19-
// Should return user, team data as well particularly for the "/conversations" endpoint
20-
} catch (error) {
21-
return {
22-
'conversations': [],
23-
'title': ''
24-
};
25-
}
11+
const res = await chatDB.get(id) as DbDoc;
12+
return {
13+
'conversations': res.conversations,
14+
'title': res.title,
15+
'createdDate': res.createdDate,
16+
'aiProvider': res.aiProvider
17+
};
18+
// Should return user, team data as well particularly for the "/conversations" endpoint
2619
}
2720

2821
export async function retrieveChatHistory(dbData: any, messages: ChatMessage[]) {

0 commit comments

Comments
 (0)