diff --git a/src/modules/data/room/roomMembers/roomMembers.composable.ts b/src/modules/data/room/roomMembers/roomMembers.composable.ts index f121d8bde3..d500b19ea3 100644 --- a/src/modules/data/room/roomMembers/roomMembers.composable.ts +++ b/src/modules/data/room/roomMembers/roomMembers.composable.ts @@ -6,8 +6,6 @@ import { SchoolApiFactory, RoomMemberResponse, SchoolForExternalInviteResponse, - UserIdAndRole, - UserIdAndRoleRoleNameEnum, } from "@/serverApi/v3"; import { $axios } from "@/utils/api"; import { useI18n } from "vue-i18n"; @@ -112,15 +110,8 @@ export const useRoomMembers = (roomId: string) => { userIds.includes(member.userId) ); - const userIdsAndRoles: UserIdAndRole[] = newMembers.map((member) => ({ - userId: member.userId, - roleName: UserIdAndRoleRoleNameEnum.Roomeditor, - })); - try { - await roomApi.roomControllerAddMembers(roomId, { - userIdsAndRoles, - }); + await roomApi.roomControllerAddMembers(roomId, { userIds }); roomMembers.value.push( ...newMembers.map((member) => ({ ...member, diff --git a/src/modules/data/room/roomMembers/roomMembers.composable.unit.ts b/src/modules/data/room/roomMembers/roomMembers.composable.unit.ts index fa066e906b..cfe59bb320 100644 --- a/src/modules/data/room/roomMembers/roomMembers.composable.unit.ts +++ b/src/modules/data/room/roomMembers/roomMembers.composable.unit.ts @@ -16,7 +16,6 @@ import { RoleName, RoomMemberResponse, SchoolUserListResponse, - UserIdAndRoleRoleNameEnum, } from "@/serverApi/v3/api"; import { useBoardNotifier } from "@util-board"; import { schoolsModule, authModule } from "@/store"; @@ -278,12 +277,7 @@ describe("useRoomMembers", () => { expect(roomApiMock.roomControllerAddMembers).toHaveBeenCalledWith( roomId, { - userIdsAndRoles: [ - { - userId: firstPotentialMember.userId, - roleName: UserIdAndRoleRoleNameEnum.Roomeditor, - }, - ], + userIds: [firstPotentialMember.userId], } ); expect(roomMembers.value).toEqual([ diff --git a/src/serverApi/v3/api.ts b/src/serverApi/v3/api.ts index 7d27309205..1e6ef9bd53 100644 --- a/src/serverApi/v3/api.ts +++ b/src/serverApi/v3/api.ts @@ -121,11 +121,11 @@ export interface AccountSearchListResponse { */ export interface AddRoomMembersBodyParams { /** - * Array of userIds and their roles inside of the room - * @type {Array} + * The IDs of the users + * @type {Array} * @memberof AddRoomMembersBodyParams */ - userIdsAndRoles: Array; + userIds: Array; } /** * @@ -9449,37 +9449,6 @@ export interface UserDataResponse { */ userId: string; } -/** - * - * @export - * @interface UserIdAndRole - */ -export interface UserIdAndRole { - /** - * The ID of the user - * @type {string} - * @memberof UserIdAndRole - */ - userId: string; - /** - * The role of the user - * @type {string} - * @memberof UserIdAndRole - */ - roleName: UserIdAndRoleRoleNameEnum; -} - -/** - * @export - * @enum {string} - */ -export enum UserIdAndRoleRoleNameEnum { - Roomowner = 'roomowner', - Roomadmin = 'roomadmin', - Roomeditor = 'roomeditor', - Roomviewer = 'roomviewer' -} - /** * * @export