ChatMessage Order Fixed

This commit is contained in:
Atish Amte
2023-07-15 00:49:31 +05:30
committed by GitHub
parent ab0534169c
commit f893edcc02
+7 -2
View File
@@ -306,8 +306,13 @@ export class App {
// Get all chatmessages from chatflowid
this.app.get('/api/v1/chatmessage/:id', async (req: Request, res: Response) => {
const chatmessages = await this.AppDataSource.getRepository(ChatMessage).findBy({
chatflowid: req.params.id
const chatmessages = await this.AppDataSource.getRepository(ChatMessage).find({
where: {
chatflowid: req.params.id
},
order: {
createdDate: 'ASC'
},
})
return res.json(chatmessages)
})