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:
@@ -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 ? {
|
||||
|
||||
Reference in New Issue
Block a user