Merge branch 'max_dev' of Software_Engineering_I/greenvironment-frontend into master
commit
b51ee6226f
@ -0,0 +1,12 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { SettingsService } from './settings.service';
|
||||
|
||||
describe('SettingsService', () => {
|
||||
beforeEach(() => TestBed.configureTestingModule({}));
|
||||
|
||||
it('should be created', () => {
|
||||
const service: SettingsService = TestBed.get(SettingsService);
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
@ -0,0 +1,25 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
import {Http} from '@angular/http';
|
||||
import { User } from 'src/app/models/user';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SettingsService {
|
||||
|
||||
users: Array<User>;
|
||||
constructor(private http: Http) {
|
||||
}
|
||||
|
||||
public buildJsonDarkMode(setting_: string): any {
|
||||
const body = {
|
||||
query: `mutation($setting: String!) {
|
||||
setUserSettings(settings: $setting)
|
||||
}`
|
||||
, variables: {
|
||||
setting: setting_
|
||||
}
|
||||
};
|
||||
return body;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue