diff --git a/frontend/projects/shared-meet-components/src/lib/pages/console/rooms/room-wizard/room-wizard.component.ts b/frontend/projects/shared-meet-components/src/lib/pages/console/rooms/room-wizard/room-wizard.component.ts index 2688d10..7c4613a 100644 --- a/frontend/projects/shared-meet-components/src/lib/pages/console/rooms/room-wizard/room-wizard.component.ts +++ b/frontend/projects/shared-meet-components/src/lib/pages/console/rooms/room-wizard/room-wizard.component.ts @@ -155,7 +155,7 @@ export class RoomWizardComponent implements OnInit { try { if (this.editMode && this.roomId && roomOptions.preferences) { - await this.roomService.updateRoom(this.roomId, roomOptions.preferences); + await this.roomService.updateRoomPreferences(this.roomId, roomOptions.preferences); await this.navigationService.navigateTo('rooms', undefined, true); this.notificationService.showSnackbar('Room updated successfully'); } else { diff --git a/frontend/projects/shared-meet-components/src/lib/services/room.service.ts b/frontend/projects/shared-meet-components/src/lib/services/room.service.ts index daf1297..5393468 100644 --- a/frontend/projects/shared-meet-components/src/lib/services/room.service.ts +++ b/frontend/projects/shared-meet-components/src/lib/services/room.service.ts @@ -151,15 +151,9 @@ export class RoomService { this.log.d('Fetching room preferences for roomId:', roomId); try { - const path = `${this.INTERNAL_ROOMS_API}/${roomId}/preferences`; + const path = `${this.ROOMS_API}/${roomId}/preferences`; const headers = this.participantService.getParticipantRoleHeader(); const preferences = await this.httpService.getRequest(path, headers); - - if (!preferences) { - this.log.w('Room preferences not found for roomId:', roomId); - throw new Error(`Preferences not found for roomId: ${roomId}`); - } - return preferences; } catch (error) { this.log.e('Error fetching room preferences', error); @@ -173,7 +167,6 @@ export class RoomService { * @param roomId - The unique identifier of the room */ async loadRoomPreferences(roomId: string): Promise { - this.log.d('Fetching room preferences from server'); try { const preferences = await this.getRoomPreferences(roomId); this.featureConfService.setRoomPreferences(preferences); @@ -191,10 +184,10 @@ export class RoomService { * @param preferences - The room preferences to be saved. * @returns A promise that resolves when the preferences have been saved. */ - async updateRoom(roomId: string, preferences: MeetRoomPreferences): Promise { + async updateRoomPreferences(roomId: string, preferences: MeetRoomPreferences): Promise { this.log.d('Saving room preferences', preferences); - const path = `${this.ROOMS_API}/${roomId}`; - await this.httpService.putRequest(path, preferences); + const path = `${this.ROOMS_API}/${roomId}/preferences`; + await this.httpService.putRequest(path, { preferences }); } /**