fix(backend/dm): include attachmentUrl + replyTo in history response
Map-response dropped attachment fields and reply reference even though getDmHistory loads them — caused images and reply quotes to disappear on conversation re-open. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
6bbf9e4cfd
commit
2cc0b20fc8
@ -27,10 +27,23 @@ export default defineEventHandler(async (event) => {
|
|||||||
: { id: partnerId, nickname: "Anonym", username: "anonym", avatar: null },
|
: { id: partnerId, nickname: "Anonym", username: "anonym", avatar: null },
|
||||||
messages: [...messages].reverse().map((m) => ({
|
messages: [...messages].reverse().map((m) => ({
|
||||||
id: m.id,
|
id: m.id,
|
||||||
|
senderId: m.senderId,
|
||||||
|
receiverId: m.receiverId,
|
||||||
content: m.content,
|
content: m.content,
|
||||||
createdAt: m.createdAt,
|
createdAt: m.createdAt,
|
||||||
isOwn: m.senderId === user.id,
|
isOwn: m.senderId === user.id,
|
||||||
readAt: m.readAt,
|
readAt: m.readAt,
|
||||||
|
attachmentUrl: m.attachmentUrl,
|
||||||
|
attachmentType: m.attachmentType,
|
||||||
|
attachmentName: m.attachmentName,
|
||||||
|
likesCount: m.likesCount,
|
||||||
|
replyTo: m.replyTo
|
||||||
|
? {
|
||||||
|
id: m.replyTo.id,
|
||||||
|
senderId: m.replyTo.senderId,
|
||||||
|
content: m.replyTo.content,
|
||||||
|
}
|
||||||
|
: null,
|
||||||
})),
|
})),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user