dark theme is stored in user settings now
parent
33fe3ae788
commit
0a87c3431f
@ -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