Chore: ng lint using the recommended @angular-eslint style
This commit is contained in:
@ -20,43 +20,41 @@ export class ModifierCategoryService {
|
||||
|
||||
get(id: string | null): Observable<ModifierCategory> {
|
||||
const getUrl: string = id === null ? url : `${url}/${id}`;
|
||||
return <Observable<ModifierCategory>>(
|
||||
this.http
|
||||
.get<ModifierCategory>(getUrl)
|
||||
.pipe(catchError(this.log.handleError(serviceName, `get id=${id}`)))
|
||||
);
|
||||
return this.http
|
||||
.get<ModifierCategory>(getUrl)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, `get id=${id}`)),
|
||||
) as Observable<ModifierCategory>;
|
||||
}
|
||||
|
||||
list(): Observable<ModifierCategory[]> {
|
||||
return <Observable<ModifierCategory[]>>(
|
||||
this.http
|
||||
.get<ModifierCategory[]>(`${url}/list`)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'list')))
|
||||
);
|
||||
return this.http
|
||||
.get<ModifierCategory[]>(`${url}/list`)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'list'))) as Observable<
|
||||
ModifierCategory[]
|
||||
>;
|
||||
}
|
||||
|
||||
listForProduct(id: string): Observable<ModifierCategory[]> {
|
||||
return <Observable<ModifierCategory[]>>(
|
||||
this.http
|
||||
.get<ModifierCategory[]>(`${url}/for-product/${id}`)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'listIsActiveOfProduct')))
|
||||
);
|
||||
return this.http
|
||||
.get<ModifierCategory[]>(`${url}/for-product/${id}`)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'listIsActiveOfProduct'))) as Observable<
|
||||
ModifierCategory[]
|
||||
>;
|
||||
}
|
||||
|
||||
save(modifierCategory: ModifierCategory): Observable<ModifierCategory> {
|
||||
return <Observable<ModifierCategory>>(
|
||||
this.http
|
||||
.post<ModifierCategory>(url, modifierCategory, httpOptions)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'save')))
|
||||
);
|
||||
return this.http
|
||||
.post<ModifierCategory>(url, modifierCategory, httpOptions)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'save'))) as Observable<ModifierCategory>;
|
||||
}
|
||||
|
||||
update(modifierCategory: ModifierCategory): Observable<ModifierCategory> {
|
||||
return <Observable<ModifierCategory>>(
|
||||
this.http
|
||||
.put<ModifierCategory>(`${url}/${modifierCategory.id}`, modifierCategory, httpOptions)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'update')))
|
||||
);
|
||||
return this.http
|
||||
.put<ModifierCategory>(`${url}/${modifierCategory.id}`, modifierCategory, httpOptions)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, 'update')),
|
||||
) as Observable<ModifierCategory>;
|
||||
}
|
||||
|
||||
saveOrUpdate(modifierCategory: ModifierCategory): Observable<ModifierCategory> {
|
||||
@ -67,10 +65,10 @@ export class ModifierCategoryService {
|
||||
}
|
||||
|
||||
delete(id: string): Observable<ModifierCategory> {
|
||||
return <Observable<ModifierCategory>>(
|
||||
this.http
|
||||
.delete<ModifierCategory>(`${url}/${id}`, httpOptions)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'delete')))
|
||||
);
|
||||
return this.http
|
||||
.delete<ModifierCategory>(`${url}/${id}`, httpOptions)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, 'delete')),
|
||||
) as Observable<ModifierCategory>;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user