Removed the use of any and enabled the rule in eslint.

Now according to me the conversion is final.
Testing is required.
This commit is contained in:
tanshu committed 2020-11-24 08:03:43 +05:30
1 parent 715e35ef38
commit 2972203148
92 files changed
+610 -378

No files matched your search

+25 -21
View File
@@ -6,35 +6,37 @@ import { catchError } from 'rxjs/operators';
import { ErrorLoggerService } from '../core/error-logger.service';
import { Product } from '../core/product';
import { LockInfo } from './lock-info';
const serviceName = 'SettingsService';
@Injectable({ providedIn: 'root' })
export class SettingsService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
getLockInformation(): Observable<any> {
getLockInformation(): Observable<LockInfo> {
const url = '/api/lock-information';
return <Observable<any>>(
return <Observable<LockInfo>>(
this.http
.get<any>(url)
.get<LockInfo>(url)
.pipe(catchError(this.log.handleError(serviceName, 'getLockInformation')))
);
}
setLockInformation(lockInformation: any): Observable<any> {
setLockInformation(lockInformation: LockInfo): Observable<LockInfo> {
const url = '/api/lock-information';
return <Observable<any>>(
return <Observable<LockInfo>>(
this.http
.post<any>(url, lockInformation)
.post<LockInfo>(url, lockInformation)
.pipe(catchError(this.log.handleError(serviceName, 'setLockInformation')))
);
}
deleteLockInformation(): Observable<any> {
deleteLockInformation(): Observable<LockInfo> {
const url = '/api/lock-information';
return <Observable<any>>(
return <Observable<LockInfo>>(
this.http
.delete<any>(url)
.delete<LockInfo>(url)
.pipe(catchError(this.log.handleError(serviceName, 'deleteLockInformation')))
);
}
@@ -51,34 +53,36 @@ export class SettingsService {
.pipe(catchError(this.log.handleError(serviceName, 'resetStock')));
}
rebaseDatabase(date: string): Observable<boolean> {
rebaseDatabase(date: string): Observable<{}> {
const url = '/api/rebase';
return <Observable<any>>(
return <Observable<{}>>(
this.http
.post<any>(`${url}/${date}`, {})
.post<{}>(`${url}/${date}`, {})
.pipe(catchError(this.log.handleError(serviceName, 'rebaseDatabase')))
);
}
setMaintenance(enable: boolean): Observable<any> {
setMaintenance(enable: boolean): Observable<{ enabled: boolean; user: string }> {
const url = '/api/maintenance';
return this.http
.post<any>(url, { enabled: enable })
return <Observable<{ enabled: boolean; user: string }>>this.http
.post<{ enabled: boolean; user: string }>(url, { enabled: enable })
.pipe(catchError(this.log.handleError(serviceName, 'setMaintenance')));
}
getMaintenance(): Observable<any> {
getMaintenance(): Observable<{ enabled: boolean; user: string }> {
const url = '/api/maintenance';
return <Observable<any>>(
this.http.get<any>(url).pipe(catchError(this.log.handleError(serviceName, 'getMaintenance')))
return <Observable<{ enabled: boolean; user: string }>>(
this.http
.get<{ enabled: boolean; user: string }>(url)
.pipe(catchError(this.log.handleError(serviceName, 'getMaintenance')))
);
}
checkDatabaseIntegrity(): Observable<any> {
checkDatabaseIntegrity(): Observable<{ 'Duplicate Attendances Fixed': number }> {
const url = '/api/db-integrity';
return <Observable<any>>(
return <Observable<{ 'Duplicate Attendances Fixed': number }>>(
this.http
.post<any>(url, {})
.post<{ 'Duplicate Attendances Fixed': number }>(url, {})
.pipe(catchError(this.log.handleError(serviceName, 'checkDatabaseIntegrity')))
);
}