Chore: ng lint using the recommended @angular-eslint style
This commit is contained in:
@ -20,35 +20,27 @@ export class SectionService {
|
||||
|
||||
get(id: string | null): Observable<Section> {
|
||||
const getUrl: string = id === null ? url : `${url}/${id}`;
|
||||
return <Observable<Section>>(
|
||||
this.http
|
||||
.get<Section>(getUrl)
|
||||
.pipe(catchError(this.log.handleError(serviceName, `get id=${id}`)))
|
||||
);
|
||||
return this.http
|
||||
.get<Section>(getUrl)
|
||||
.pipe(catchError(this.log.handleError(serviceName, `get id=${id}`))) as Observable<Section>;
|
||||
}
|
||||
|
||||
list(): Observable<Section[]> {
|
||||
return <Observable<Section[]>>(
|
||||
this.http
|
||||
.get<Section[]>(`${url}/list`)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'list')))
|
||||
);
|
||||
return this.http
|
||||
.get<Section[]>(`${url}/list`)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'list'))) as Observable<Section[]>;
|
||||
}
|
||||
|
||||
save(section: Section): Observable<Section> {
|
||||
return <Observable<Section>>(
|
||||
this.http
|
||||
.post<Section>(url, section, httpOptions)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'save')))
|
||||
);
|
||||
return this.http
|
||||
.post<Section>(url, section, httpOptions)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'save'))) as Observable<Section>;
|
||||
}
|
||||
|
||||
update(section: Section): Observable<Section> {
|
||||
return <Observable<Section>>(
|
||||
this.http
|
||||
.put<Section>(`${url}/${section.id}`, section, httpOptions)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'update')))
|
||||
);
|
||||
return this.http
|
||||
.put<Section>(`${url}/${section.id}`, section, httpOptions)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'update'))) as Observable<Section>;
|
||||
}
|
||||
|
||||
saveOrUpdate(section: Section): Observable<Section> {
|
||||
@ -59,10 +51,8 @@ export class SectionService {
|
||||
}
|
||||
|
||||
delete(id: string): Observable<Section> {
|
||||
return <Observable<Section>>(
|
||||
this.http
|
||||
.delete<Section>(`${url}/${id}`, httpOptions)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'delete')))
|
||||
);
|
||||
return this.http
|
||||
.delete<Section>(`${url}/${id}`, httpOptions)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'delete'))) as Observable<Section>;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user