add settings page + config settings
This commit is contained in:
1 parent
b872cd0733
commit
c3294a1ab9
19 files changed
+359
-25
No files matched your search
@@ -0,0 +1,25 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { environment } from '../../../environments/environment.prod';
|
||||
import { Settings } from '../../shared/models/settings.model';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class SettingsService {
|
||||
private backend_apiUrl = environment.API_URL;
|
||||
private apiAction = 'settings';
|
||||
|
||||
constructor(private http: HttpClient) {}
|
||||
|
||||
getSettings() {
|
||||
return this.http.get<Settings>(`${this.backend_apiUrl}/${this.apiAction}`);
|
||||
}
|
||||
|
||||
updateSettings(settings: Settings) {
|
||||
return this.http.put<any>(
|
||||
`${this.backend_apiUrl}/${this.apiAction}`,
|
||||
settings
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user