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

@ -20,51 +20,41 @@ export class TableService {
get(id: string | null): Observable<Table> {
const getUrl: string = id === null ? url : `${url}/${id}`;
return <Observable<Table>>(
this.http
.get<Table>(getUrl)
.pipe(catchError(this.log.handleError(serviceName, `get id=${id}`)))
);
return this.http
.get<Table>(getUrl)
.pipe(catchError(this.log.handleError(serviceName, `get id=${id}`))) as Observable<Table>;
}
list(): Observable<Table[]> {
return <Observable<Table[]>>(
this.http
.get<Table[]>(`${url}/list`)
.pipe(catchError(this.log.handleError(serviceName, 'list')))
);
return this.http
.get<Table[]>(`${url}/list`)
.pipe(catchError(this.log.handleError(serviceName, 'list'))) as Observable<Table[]>;
}
running(): Observable<Table[]> {
return <Observable<Table[]>>(
this.http
.get<Table[]>(`${url}/running`)
.pipe(catchError(this.log.handleError(serviceName, 'running')))
);
return this.http
.get<Table[]>(`${url}/running`)
.pipe(catchError(this.log.handleError(serviceName, 'running'))) as Observable<Table[]>;
}
save(tables: Table): Observable<Table> {
return <Observable<Table>>(
this.http
.post<Table>(url, tables, httpOptions)
.pipe(catchError(this.log.handleError(serviceName, 'save')))
);
return this.http
.post<Table>(url, tables, httpOptions)
.pipe(catchError(this.log.handleError(serviceName, 'save'))) as Observable<Table>;
}
update(tables: Table): Observable<Table> {
return <Observable<Table>>(
this.http
.put<Table>(`${url}/${tables.id}`, tables, httpOptions)
.pipe(catchError(this.log.handleError(serviceName, 'update')))
);
return this.http
.put<Table>(`${url}/${tables.id}`, tables, httpOptions)
.pipe(catchError(this.log.handleError(serviceName, 'update'))) as Observable<Table>;
}
updateSortOrder(list: Table[]): Observable<boolean> {
return <Observable<boolean>>(
this.http
.post<Table[]>(`${url}/list`, list, httpOptions)
.pipe(catchError(this.log.handleError(serviceName, 'updateSortOrder')))
);
return this.http
.post<Table[]>(`${url}/list`, list, httpOptions)
.pipe(
catchError(this.log.handleError(serviceName, 'updateSortOrder')),
) as Observable<boolean>;
}
saveOrUpdate(tables: Table): Observable<Table> {
@ -75,10 +65,8 @@ export class TableService {
}
delete(id: string): Observable<Table> {
return <Observable<Table>>(
this.http
.delete<Table>(`${url}/${id}`, httpOptions)
.pipe(catchError(this.log.handleError(serviceName, 'delete')))
);
return this.http
.delete<Table>(`${url}/${id}`, httpOptions)
.pipe(catchError(this.log.handleError(serviceName, 'delete'))) as Observable<Table>;
}
}