feat: display specific truncated content for image and file messages in conversations.

This commit is contained in:
pradeepkumar
2026-03-27 06:24:02 +05:30
parent 59e9a7098b
commit 486b9f9421

View File

@@ -240,8 +240,15 @@ export class MessagesService {
});
// Update conversation with last message info and unread counts
const truncatedContent =
dto.content.length > 255 ? dto.content.substring(0, 252) + '...' : dto.content;
let truncatedContent: string;
if (dto.messageType === 'IMAGE') {
truncatedContent = 'Sent an image';
} else if (dto.messageType === 'FILE') {
truncatedContent = 'Sent a file';
} else {
truncatedContent =
dto.content.length > 255 ? dto.content.substring(0, 252) + '...' : dto.content;
}
await this.prisma.conversation.update({
where: { id: conversationId },