Skip to content

Commit ae50443

Browse files
authored
Merge pull request #545 from atishamte/bugfix/chatMessageOrder
ChatMessage Order Fixed
2 parents 7d985db + 78ee455 commit ae50443

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/server/src/index.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,13 @@ export class App {
306306

307307
// Get all chatmessages from chatflowid
308308
this.app.get('/api/v1/chatmessage/:id', async (req: Request, res: Response) => {
309-
const chatmessages = await this.AppDataSource.getRepository(ChatMessage).findBy({
310-
chatflowid: req.params.id
309+
const chatmessages = await this.AppDataSource.getRepository(ChatMessage).find({
310+
where: {
311+
chatflowid: req.params.id
312+
},
313+
order: {
314+
createdDate: 'ASC'
315+
}
311316
})
312317
return res.json(chatmessages)
313318
})

0 commit comments

Comments
 (0)