Skip to content

Commit

Permalink
fix: fixing bug of cannot delete chat history
Browse files Browse the repository at this point in the history
  • Loading branch information
NarwhalChen committed Jan 22, 2025
1 parent c475dc6 commit 31eb089
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions backend/src/chat/chat.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,13 @@ export class ChatService {
async deleteChat(chatId: string): Promise<boolean> {
const chat = await this.chatRepository.findOne({
where: { id: chatId, isDeleted: false },
relations: ['messages'],
});

if (chat) {
// Soft delete the chat
chat.isDeleted = true;
chat.isActive = false;
await this.chatRepository.save(chat);

return true;
}
return false;
Expand Down

0 comments on commit 31eb089

Please sign in to comment.