Chore: ng lint using the recommended @angular-eslint style
This commit is contained in:
@ -45,8 +45,8 @@ export class ModifierListDataSource extends DataSource<Modifier> {
|
||||
|
||||
private getFilteredData(data: Modifier[]): Modifier[] {
|
||||
const filter = this.filterValue === undefined ? '' : this.filterValue;
|
||||
return data.filter((x) => {
|
||||
return (x.modifierCategory as ModifierCategory).id === filter || filter === '';
|
||||
});
|
||||
return data.filter(
|
||||
(x) => (x.modifierCategory as ModifierCategory).id === filter || filter === '',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,35 +19,27 @@ export class ModifierService {
|
||||
|
||||
get(id: string | null): Observable<Modifier> {
|
||||
const getUrl: string = id === null ? url : `${url}/${id}`;
|
||||
return <Observable<Modifier>>(
|
||||
this.http
|
||||
.get<Modifier>(getUrl)
|
||||
.pipe(catchError(this.log.handleError(serviceName, `get id=${id}`)))
|
||||
);
|
||||
return this.http
|
||||
.get<Modifier>(getUrl)
|
||||
.pipe(catchError(this.log.handleError(serviceName, `get id=${id}`))) as Observable<Modifier>;
|
||||
}
|
||||
|
||||
list(): Observable<Modifier[]> {
|
||||
return <Observable<Modifier[]>>(
|
||||
this.http
|
||||
.get<Modifier[]>(`${url}/list`)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'getList')))
|
||||
);
|
||||
return this.http
|
||||
.get<Modifier[]>(`${url}/list`)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'getList'))) as Observable<Modifier[]>;
|
||||
}
|
||||
|
||||
save(modifier: Modifier): Observable<Modifier> {
|
||||
return <Observable<Modifier>>(
|
||||
this.http
|
||||
.post<Modifier>(url, modifier, httpOptions)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'save')))
|
||||
);
|
||||
return this.http
|
||||
.post<Modifier>(url, modifier, httpOptions)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'save'))) as Observable<Modifier>;
|
||||
}
|
||||
|
||||
update(modifier: Modifier): Observable<Modifier> {
|
||||
return <Observable<Modifier>>(
|
||||
this.http
|
||||
.put<Modifier>(`${url}/${modifier.id}`, modifier, httpOptions)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'update')))
|
||||
);
|
||||
return this.http
|
||||
.put<Modifier>(`${url}/${modifier.id}`, modifier, httpOptions)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'update'))) as Observable<Modifier>;
|
||||
}
|
||||
|
||||
saveOrUpdate(modifier: Modifier): Observable<Modifier> {
|
||||
@ -58,10 +50,8 @@ export class ModifierService {
|
||||
}
|
||||
|
||||
delete(id: string): Observable<Modifier> {
|
||||
return <Observable<Modifier>>(
|
||||
this.http
|
||||
.delete<Modifier>(`${url}/${id}`, httpOptions)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'delete')))
|
||||
);
|
||||
return this.http
|
||||
.delete<Modifier>(`${url}/${id}`, httpOptions)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'delete'))) as Observable<Modifier>;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user