fix(dm): restore ownerId=NULL semantics for 1-on-1 DM channels

- Add migrateFixOneOnOneOwnerIds migration to NULL-out ownerId on all
  existing 1-on-1 DMs (those with exactly 2 members)
- Fix POST /api/dm to create 1-on-1 channels with ownerId=null instead
  of the creator's ID
- Guard POST /api/dm/:id/members: reject with 400 if channel has no
  owner (i.e. is a 1-on-1), directing callers to POST /api/dm/group
- Guard DELETE /api/dm/:id/members: replace member-count check with
  ownerId check; remove now-duplicate dmChannel query in that handler
- Add CreateGroupDmRequest type to shared types
This commit is contained in:
Jannis Braun
2026-03-26 22:16:55 +01:00
parent 0bcba2aaa9
commit bec4c2446f
3 changed files with 42 additions and 15 deletions
+4
View File
@@ -516,6 +516,10 @@ export interface AddDmMemberRequest {
userId: string;
}
export interface CreateGroupDmRequest {
userIds: string[];
}
export interface CreateDmMessageRequest {
content?: string;
attachments?: string[];