Skip to content

Commit

Permalink
updated conversation history API
Browse files Browse the repository at this point in the history
  • Loading branch information
Amruth-Vamshi committed Oct 18, 2023
1 parent 10b6760 commit 07824a7
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/modules/user/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,22 @@ export class UserService {
queryId: data.id
}
})
for(let doc of data["context"]){
doc["metaData"] = (await this.prisma.document.findUnique({
where: {
id: doc.id
},
select: {
metaData: true
}
}))['metaData']
if(data["context"]){
for(let doc of data["context"]){
doc["metaData"] = (await this.prisma.document.findUnique({
where: {
id: doc.id
},
select: {
metaData: true
}
}))['metaData']
}
}
}
return userHistory;
} catch (error) {
console.log(error)
throw new BadRequestException([
"Something went wrong while fetching conversation history",
]);
Expand Down

0 comments on commit 07824a7

Please sign in to comment.