Merge pull request #545 from atishamte/bugfix/chatMessageOrder

ChatMessage Order Fixed
This commit is contained in:
Ong Chung Yau 2023-07-17 22:10:50 +08:00 committed by GitHub
commit ae50443ec1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -306,8 +306,13 @@ export class App {
// Get all chatmessages from chatflowid // Get all chatmessages from chatflowid
this.app.get('/api/v1/chatmessage/:id', async (req: Request, res: Response) => { this.app.get('/api/v1/chatmessage/:id', async (req: Request, res: Response) => {
const chatmessages = await this.AppDataSource.getRepository(ChatMessage).findBy({ const chatmessages = await this.AppDataSource.getRepository(ChatMessage).find({
where: {
chatflowid: req.params.id chatflowid: req.params.id
},
order: {
createdDate: 'ASC'
}
}) })
return res.json(chatmessages) return res.json(chatmessages)
}) })