Use frontend settings instead of env variable

This commit is contained in:
Michael Shamoon
2022-08-07 15:05:58 -07:00
parent 817882ff6f
commit 6fa32c36e9
11 changed files with 63 additions and 126 deletions

View File

@@ -1,16 +0,0 @@
import { TestBed } from '@angular/core/testing';
import { EnvironmentService } from './environment.service';
describe('EnvironmentService', () => {
let service: EnvironmentService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(EnvironmentService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});

View File

@@ -1,22 +0,0 @@
import { HttpClient, HttpParams } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { PaperlessEnvironment } from 'src/app/data/paperless-environment';
import { environment } from 'src/environments/environment'
@Injectable({
providedIn: 'root'
})
export class EnvironmentService {
protected baseUrl: string = environment.apiBaseUrl
constructor(protected http: HttpClient) { }
get(environment: string): Observable<PaperlessEnvironment> {
let httpParams = new HttpParams();
httpParams = httpParams.set('name', environment);
return this.http.get<PaperlessEnvironment>(`${this.baseUrl}environment/`, {params: httpParams})
}
}