frontend: add methods to get and save rooms appearance configuration

This commit is contained in:
juancarmore 2025-09-19 11:35:40 +02:00
parent 1f24c461b8
commit ace0033720

View File

@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
import { HttpService } from '@lib/services';
import { AuthMode, SecurityConfig, WebhookConfig } from '@lib/typings/ce';
import { AuthMode, MeetAppearanceConfig, SecurityConfig, WebhookConfig } from '@lib/typings/ce';
import { LoggerService } from 'openvidu-components-angular';
@Injectable({
@ -47,13 +47,8 @@ export class GlobalConfigService {
}
async getWebhookConfig(): Promise<WebhookConfig> {
try {
const path = `${this.GLOBAL_CONFIG_API}/webhooks`;
return await this.httpService.getRequest<WebhookConfig>(path);
} catch (error) {
this.log.e('Error fetching webhook config:', error);
throw error;
}
}
async saveWebhookConfig(config: WebhookConfig) {
@ -65,4 +60,14 @@ export class GlobalConfigService {
const path = `${this.GLOBAL_CONFIG_API}/webhooks/test`;
await this.httpService.postRequest(path, { url });
}
async getRoomsAppearanceConfig(): Promise<{ appearance: MeetAppearanceConfig }> {
const path = `${this.GLOBAL_CONFIG_API}/rooms/appearance`;
return await this.httpService.getRequest<{ appearance: MeetAppearanceConfig }>(path);
}
async saveRoomsAppearanceConfig(config: MeetAppearanceConfig) {
const path = `${this.GLOBAL_CONFIG_API}/rooms/appearance`;
await this.httpService.putRequest(path, { appearance: config });
}
}