import {APIService} from './api-service';

export interface MutableConfig {
  externalURL?: string;
  makeflowAddress?: string;
  makeflowPowerAppName?: string;
  makeflowPowerAppDisplayName?: string;
  makeflowPowerAppDescription?: string;
}

export class ConfigService {
  constructor(private apiService: APIService) {}

  async getMutableConfig(): Promise<MutableConfig> {
    return this.apiService.post('/api/config/get-mutable-config');
  }

  async updateConfig(config: MutableConfig): Promise<void> {
    return this.apiService.post('/api/config/update-config', config);
  }
}
