Feat: Exclude reference from the data returned by the conversation/get interface #3909 (#3962)

### What problem does this PR solve?

Feat: Exclude reference from the data returned by the conversation/get
interface #3909

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-12-10 16:46:47 +08:00
committed by GitHub
parent fc4e644e5f
commit 601d74160b
3 changed files with 8 additions and 12 deletions

View File

@ -1,6 +1,7 @@
import { EmptyConversationId, MessageType } from '@/constants/chat';
import { Message } from '@/interfaces/database/chat';
import { IMessage } from '@/pages/chat/interface';
import { omit } from 'lodash';
import { v4 as uuid } from 'uuid';
export const isConversationIdExist = (conversationId: string) => {
@ -27,7 +28,7 @@ export const getMessagePureId = (id?: string) => {
export const buildMessageListWithUuid = (messages?: Message[]) => {
return (
messages?.map((x: Message | IMessage) => ({
...x,
...omit(x, 'reference'),
id: buildMessageUuid(x),
})) ?? []
);