frontend: rename updateRoom method to updateRoomPreferences and adjust API path
This commit is contained in:
parent
3322723b8d
commit
6b0df53614
@ -155,7 +155,7 @@ export class RoomWizardComponent implements OnInit {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (this.editMode && this.roomId && roomOptions.preferences) {
|
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);
|
await this.navigationService.navigateTo('rooms', undefined, true);
|
||||||
this.notificationService.showSnackbar('Room updated successfully');
|
this.notificationService.showSnackbar('Room updated successfully');
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -151,15 +151,9 @@ export class RoomService {
|
|||||||
this.log.d('Fetching room preferences for roomId:', roomId);
|
this.log.d('Fetching room preferences for roomId:', roomId);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const path = `${this.INTERNAL_ROOMS_API}/${roomId}/preferences`;
|
const path = `${this.ROOMS_API}/${roomId}/preferences`;
|
||||||
const headers = this.participantService.getParticipantRoleHeader();
|
const headers = this.participantService.getParticipantRoleHeader();
|
||||||
const preferences = await this.httpService.getRequest<MeetRoomPreferences>(path, headers);
|
const preferences = await this.httpService.getRequest<MeetRoomPreferences>(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;
|
return preferences;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.log.e('Error fetching room preferences', error);
|
this.log.e('Error fetching room preferences', error);
|
||||||
@ -173,7 +167,6 @@ export class RoomService {
|
|||||||
* @param roomId - The unique identifier of the room
|
* @param roomId - The unique identifier of the room
|
||||||
*/
|
*/
|
||||||
async loadRoomPreferences(roomId: string): Promise<void> {
|
async loadRoomPreferences(roomId: string): Promise<void> {
|
||||||
this.log.d('Fetching room preferences from server');
|
|
||||||
try {
|
try {
|
||||||
const preferences = await this.getRoomPreferences(roomId);
|
const preferences = await this.getRoomPreferences(roomId);
|
||||||
this.featureConfService.setRoomPreferences(preferences);
|
this.featureConfService.setRoomPreferences(preferences);
|
||||||
@ -191,10 +184,10 @@ export class RoomService {
|
|||||||
* @param preferences - The room preferences to be saved.
|
* @param preferences - The room preferences to be saved.
|
||||||
* @returns A promise that resolves when the preferences have been saved.
|
* @returns A promise that resolves when the preferences have been saved.
|
||||||
*/
|
*/
|
||||||
async updateRoom(roomId: string, preferences: MeetRoomPreferences): Promise<void> {
|
async updateRoomPreferences(roomId: string, preferences: MeetRoomPreferences): Promise<void> {
|
||||||
this.log.d('Saving room preferences', preferences);
|
this.log.d('Saving room preferences', preferences);
|
||||||
const path = `${this.ROOMS_API}/${roomId}`;
|
const path = `${this.ROOMS_API}/${roomId}/preferences`;
|
||||||
await this.httpService.putRequest(path, preferences);
|
await this.httpService.putRequest(path, { preferences });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user