frontend: Update API paths in HttpService

This commit is contained in:
juancarmore 2025-04-08 10:21:33 +02:00
parent 87de44099f
commit ba844e4d77
2 changed files with 8 additions and 7 deletions

View File

@ -70,10 +70,11 @@ export class HttpService {
* @returns {Promise<GlobalPreferences>} A promise that resolves to the global preferences.
*/
getSecurityPreferences(): Promise<SecurityPreferencesDTO> {
return this.getRequest(`${this.API_PATH_PREFIX}/${this.API_V1_VERSION}/preferences/security`);
return this.getRequest(`${this.INTERNAL_API_PATH_PREFIX}/${this.API_V1_VERSION}/preferences/security`);
}
/**
* TODO: Delete this method
* Retrieves the room preferences.
*
* @returns {Promise<MeetRoomPreferences>} A promise that resolves to the room preferences.
@ -88,8 +89,8 @@ export class HttpService {
* @param preferences - The room preferences to be saved.
* @returns A promise that resolves when the preferences have been successfully saved.
*/
saveRoomPreferences(preferences: MeetRoomPreferences): Promise<any> {
return this.putRequest(`${this.API_PATH_PREFIX}/preferences/room`, preferences);
updateRoomPreferences(roomId: string, preferences: MeetRoomPreferences): Promise<any> {
return this.putRequest(`${this.INTERNAL_API_PATH_PREFIX}/room/${roomId}`, preferences);
}
login(body: { username: string; password: string }): Promise<{ message: string }> {
@ -119,11 +120,11 @@ export class HttpService {
}
startRecording(roomId: string): Promise<RecordingInfo> {
return this.postRequest(`${this.API_PATH_PREFIX}/${this.API_V1_VERSION}/recordings`, { roomId });
return this.postRequest(`${this.INTERNAL_API_PATH_PREFIX}/${this.API_V1_VERSION}/recordings`, { roomId });
}
stopRecording(recordingId: string): Promise<RecordingInfo> {
return this.putRequest(`${this.API_PATH_PREFIX}/${this.API_V1_VERSION}/recordings/${recordingId}`);
return this.putRequest(`${this.INTERNAL_API_PATH_PREFIX}/${this.API_V1_VERSION}/recordings/${recordingId}`);
}
deleteRecording(recordingId: string): Promise<RecordingInfo> {

View File

@ -55,9 +55,9 @@ export class RoomService {
* @param {RoomPreferences} preferences - The preferences to be saved.
* @returns {Promise<void>} A promise that resolves when the preferences have been saved.
*/
async saveRoomPreferences(preferences: MeetRoomPreferences): Promise<void> {
async saveRoomPreferences(roomId: string, preferences: MeetRoomPreferences): Promise<void> {
this.log.d('Saving room preferences', preferences);
await this.httpService.saveRoomPreferences(preferences);
await this.httpService.updateRoomPreferences(roomId, preferences);
this.roomPreferences = preferences;
}
}