diff --git a/ts/components/conversation/ModeratorsAddDialog.tsx b/ts/components/conversation/ModeratorsAddDialog.tsx index 9a59f9dcb..e201d2cac 100644 --- a/ts/components/conversation/ModeratorsAddDialog.tsx +++ b/ts/components/conversation/ModeratorsAddDialog.tsx @@ -7,6 +7,7 @@ import { DefaultTheme } from 'styled-components'; import { SessionSpinner } from '../session/SessionSpinner'; import { Flex } from '../basic/Flex'; import { ConversationModel } from '../../models/conversation'; +import { ApiV2 } from '../../opengroup/opengroupV2'; interface Props { convo: ConversationModel; onClose: any; @@ -63,8 +64,8 @@ export class AddModeratorsDialog extends React.Component { isAdded = await this.channelAPI.serverAPI.addModerator([pubkey.key]); } else { // this is a v2 opengroup - // FIXME audric addModerators - throw new Error('TODO'); + const roomInfos = this.props.convo.toOpenGroupV2(); + isAdded = await ApiV2.addModerator(pubkey, roomInfos); } if (!isAdded) { window.log.warn('failed to add moderators:', isAdded); diff --git a/ts/opengroup/opengroupV2/OpenGroupAPIV2.ts b/ts/opengroup/opengroupV2/OpenGroupAPIV2.ts index cd61f3d9a..03ea7013b 100644 --- a/ts/opengroup/opengroupV2/OpenGroupAPIV2.ts +++ b/ts/opengroup/opengroupV2/OpenGroupAPIV2.ts @@ -631,7 +631,7 @@ export const addModerator = async ( room: roomInfos.roomId, server: roomInfos.serverUrl, isAuthRequired: true, - queryParams: { public_key: userToAddAsMods.key }, + queryParams: { public_key: userToAddAsMods.key, room_id: roomInfos.roomId }, endpoint: 'moderators', }; const addModResult = await sendOpenGroupV2Request(request);