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

@ -17,35 +17,27 @@ export class DeviceService {
get(id: string | null): Observable<Device> {
const getUrl: string = id === null ? `${url}` : `${url}/${id}`;
return <Observable<Device>>(
this.http
.get<Device>(getUrl)
.pipe(catchError(this.log.handleError(serviceName, `get id=${id}`)))
);
return this.http
.get<Device>(getUrl)
.pipe(catchError(this.log.handleError(serviceName, `get id=${id}`))) as Observable<Device>;
}
list(): Observable<Device[]> {
return <Observable<Device[]>>(
this.http
.get<Device[]>(`${url}/list`)
.pipe(catchError(this.log.handleError(serviceName, 'list')))
);
return this.http
.get<Device[]>(`${url}/list`)
.pipe(catchError(this.log.handleError(serviceName, 'list'))) as Observable<Device[]>;
}
save(device: Device): Observable<Device> {
return <Observable<Device>>(
this.http
.post<Device>(`${url}`, device)
.pipe(catchError(this.log.handleError(serviceName, 'save')))
);
return this.http
.post<Device>(`${url}`, device)
.pipe(catchError(this.log.handleError(serviceName, 'save'))) as Observable<Device>;
}
update(device: Device): Observable<Device> {
return <Observable<Device>>(
this.http
.put<Device>(`${url}/${device.id}`, device)
.pipe(catchError(this.log.handleError(serviceName, 'update')))
);
return this.http
.put<Device>(`${url}/${device.id}`, device)
.pipe(catchError(this.log.handleError(serviceName, 'update'))) as Observable<Device>;
}
saveOrUpdate(device: Device): Observable<Device> {
@ -56,10 +48,8 @@ export class DeviceService {
}
delete(id: string): Observable<Device> {
return <Observable<Device>>(
this.http
.delete<Device>(`${url}/${id}`)
.pipe(catchError(this.log.handleError(serviceName, 'delete')))
);
return this.http
.delete<Device>(`${url}/${id}`)
.pipe(catchError(this.log.handleError(serviceName, 'delete'))) as Observable<Device>;
}
}