update system config url and http options

This commit is contained in:
Jesse Lucas 2020-03-15 12:42:55 -04:00
parent 838b2a6a34
commit fb4c7d288c

View File

@ -20,16 +20,16 @@ export class SystemConfigService {
private devices: Device[]; private devices: Device[];
private foldersSubject: Subject<Folder[]> = new Subject(); private foldersSubject: Subject<Folder[]> = new Subject();
private devicesSubject: Subject<Device[]> = new Subject(); private devicesSubject: Subject<Device[]> = new Subject();
private systemConfigUrl = environment.production ? apiURL + '/rest/system/config' : 'api/config'; private systemConfigUrl = environment.production ? apiURL + 'rest/system/config' : 'api/config';
private httpOptions; private httpOptions;
constructor(private http: HttpClient, private cookieService: CookieService) { } constructor(private http: HttpClient, private cookieService: CookieService) {
ngOnInit(): void {
this.httpOptions = { headers: new HttpHeaders(this.cookieService.getCSRFHeader()) }; this.httpOptions = { headers: new HttpHeaders(this.cookieService.getCSRFHeader()) };
} }
ngOnInit(): void { }
getSystemConfig(): Observable<any> { getSystemConfig(): Observable<any> {
return this.http return this.http
.get(this.systemConfigUrl, this.httpOptions) .get(this.systemConfigUrl, this.httpOptions)