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,34 +20,32 @@ export class SectionPrinterService {
get(id: string | null): Observable<SectionPrinter[]> {
const getUrl: string = id === null ? `${url}` : `${url}/${id}`;
return <Observable<SectionPrinter[]>>(
this.http
.get<SectionPrinter[]>(getUrl)
.pipe(catchError(this.log.handleError(serviceName, `get id=${id}`)))
);
return this.http
.get<SectionPrinter[]>(getUrl)
.pipe(catchError(this.log.handleError(serviceName, `get id=${id}`))) as Observable<
SectionPrinter[]
>;
}
// item(id: string, menuCategoryId: string): Observable<SectionPrinterItem> {
// const options = {params: new HttpParams().set('m', menuCategoryId)};
// return <Observable<SectionPrinterItem>>this.http.get<SectionPrinterItem>(`${url}/${id}`, options)
// return this.http.get<SectionPrinterItem>(`${url}/${id}`, options)
// .pipe(
// catchError(this.log.handleError(serviceName, 'list'))
// );
// ) as Observable<SectionPrinterItem>;
// }
save(sectionId: string, list: SectionPrinter[]): Observable<SectionPrinter[]> {
return <Observable<SectionPrinter[]>>(
this.http
.post<SectionPrinter[]>(`${url}/${sectionId}`, list, httpOptions)
.pipe(catchError(this.log.handleError(serviceName, 'save')))
);
return this.http
.post<SectionPrinter[]>(`${url}/${sectionId}`, list, httpOptions)
.pipe(catchError(this.log.handleError(serviceName, 'save'))) as Observable<SectionPrinter[]>;
}
delete(id: string): Observable<SectionPrinter[]> {
return <Observable<SectionPrinter[]>>(
this.http
.delete<SectionPrinter[]>(`${url}/${id}`, httpOptions)
.pipe(catchError(this.log.handleError(serviceName, 'delete')))
);
return this.http
.delete<SectionPrinter[]>(`${url}/${id}`, httpOptions)
.pipe(catchError(this.log.handleError(serviceName, 'delete'))) as Observable<
SectionPrinter[]
>;
}
}