mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-30 18:27:45 -05:00
Use frontend settings instead of env variable
This commit is contained in:
@@ -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();
|
||||
});
|
||||
});
|
@@ -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})
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user