download handout
This commit is contained in:
@@ -2,6 +2,7 @@ import {Injectable} from '@angular/core';
|
||||
import {DbService} from './db.service';
|
||||
import {Observable} from 'rxjs';
|
||||
import {Config} from './config';
|
||||
import {first} from 'rxjs/operators';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -13,4 +14,8 @@ export class ConfigService {
|
||||
public get get$(): Observable<Config> {
|
||||
return this.db.doc$<Config>('global/config');
|
||||
}
|
||||
|
||||
public async get(): Promise<Config> {
|
||||
return await this.db.doc$<Config>('global/config').pipe(first()).toPromise();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ export class UserService {
|
||||
}
|
||||
|
||||
public getUserbyId(userId: string): Promise<User> {
|
||||
return this.getUserbyId$('users/' + userId).pipe(first()).toPromise();
|
||||
return this.getUserbyId$(userId).pipe(first()).toPromise();
|
||||
}
|
||||
|
||||
public getUserbyId$(userId: string): Observable<User> {
|
||||
|
||||
Reference in New Issue
Block a user