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:
@@ -516,6 +516,10 @@ export interface AddDmMemberRequest {
|
||||
userId: string;
|
||||
}
|
||||
|
||||
export interface CreateGroupDmRequest {
|
||||
userIds: string[];
|
||||
}
|
||||
|
||||
export interface CreateDmMessageRequest {
|
||||
content?: string;
|
||||
attachments?: string[];
|
||||
|
||||
Reference in New Issue
Block a user