fix(dm): include federatedId in POST /api/dm idempotent existing-DM response

Fresh-create returned {id, ownerId, federatedId, createdAt, members, lastMessage}; the existing-DM path returned the same shape minus federatedId. Inconsistency was a footgun for any future feature reading federatedId from this response — fresh-create tests would pass while idempotent path would break. One-line addition to the result builder.
This commit is contained in:
Jannis Braun
2026-04-25 00:59:16 +02:00
parent 618056659e
commit a9bf5aeb53
2 changed files with 145 additions and 0 deletions
+1
View File
@@ -471,6 +471,7 @@ export async function dmRoutes(app: FastifyInstance): Promise<void> {
const result: DmChannel = {
id: dmChannel.id,
ownerId: dmChannel.ownerId ?? null,
federatedId: dmChannel.federatedId ?? null,
createdAt: dmChannel.createdAt,
members: users.map(u => sanitizeUser(u)),
lastMessage: lastMsg ? {