Chore: ng lint using the recommended @angular-eslint style

This commit is contained in:
2020-12-08 18:50:46 +05:30
parent 130d9197e5
commit d65379a068
50 changed files with 524 additions and 636 deletions

View File

@ -21,35 +21,27 @@ export class RoleService {
get(id: string | null): Observable<Role> {
const getUrl: string = id === null ? `${url}` : `${url}/${id}`;
return <Observable<Role>>(
this.http
.get<Role>(getUrl)
.pipe(catchError(this.log.handleError(serviceName, `get id=${id}`)))
);
return this.http
.get<Role>(getUrl)
.pipe(catchError(this.log.handleError(serviceName, `get id=${id}`))) as Observable<Role>;
}
list(): Observable<Role[]> {
return <Observable<Role[]>>(
this.http
.get<Role[]>(`${url}/list`)
.pipe(catchError(this.log.handleError(serviceName, 'list')))
);
return this.http
.get<Role[]>(`${url}/list`)
.pipe(catchError(this.log.handleError(serviceName, 'list'))) as Observable<Role[]>;
}
save(role: Role): Observable<Role> {
return <Observable<Role>>(
this.http
.post<Role>(`${url}`, role, httpOptions)
.pipe(catchError(this.log.handleError(serviceName, 'save')))
);
return this.http
.post<Role>(`${url}`, role, httpOptions)
.pipe(catchError(this.log.handleError(serviceName, 'save'))) as Observable<Role>;
}
update(role: Role): Observable<Role> {
return <Observable<Role>>(
this.http
.put<Role>(`${url}/${role.id}`, role, httpOptions)
.pipe(catchError(this.log.handleError(serviceName, 'update')))
);
return this.http
.put<Role>(`${url}/${role.id}`, role, httpOptions)
.pipe(catchError(this.log.handleError(serviceName, 'update'))) as Observable<Role>;
}
saveOrUpdate(role: Role): Observable<Role> {
@ -60,10 +52,8 @@ export class RoleService {
}
delete(id: string): Observable<Role> {
return <Observable<Role>>(
this.http
.delete<Role>(`${url}/${id}`, httpOptions)
.pipe(catchError(this.log.handleError(serviceName, 'delete')))
);
return this.http
.delete<Role>(`${url}/${id}`, httpOptions)
.pipe(catchError(this.log.handleError(serviceName, 'delete'))) as Observable<Role>;
}
}