Updated to angular 11
Now compiling with strict mode in typescript Need to error checking now
This commit is contained in:
@ -18,7 +18,7 @@ const serviceName = 'UserService';
|
||||
export class UserService {
|
||||
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
|
||||
|
||||
get(id: string): Observable<User> {
|
||||
get(id: string | null): Observable<User> {
|
||||
const getUrl: string = id === null ? `${url}` : `${url}/${id}`;
|
||||
return <Observable<User>>(
|
||||
this.http
|
||||
@ -35,14 +35,6 @@ export class UserService {
|
||||
);
|
||||
}
|
||||
|
||||
listOfNames(): Observable<string[]> {
|
||||
return <Observable<string[]>>(
|
||||
this.http
|
||||
.get<string[]>(`${url}/active`)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'list')))
|
||||
);
|
||||
}
|
||||
|
||||
save(user: User): Observable<User> {
|
||||
return <Observable<User>>(
|
||||
this.http
|
||||
|
||||
Reference in New Issue
Block a user