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:
10
overlord/src/app/core/account-balance.ts
Normal file
10
overlord/src/app/core/account-balance.ts
Normal file
@ -0,0 +1,10 @@
|
||||
export class AccountBalance {
|
||||
date: number;
|
||||
total: number;
|
||||
|
||||
public constructor(init?: Partial<AccountBalance>) {
|
||||
this.date = 0;
|
||||
this.total = 0;
|
||||
Object.assign(this, init);
|
||||
}
|
||||
}
|
||||
@ -4,6 +4,7 @@ import { Observable } from 'rxjs/internal/Observable';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
|
||||
import { Account } from './account';
|
||||
import { AccountBalance } from './account-balance';
|
||||
import { ErrorLoggerService } from './error-logger.service';
|
||||
|
||||
const httpOptions = {
|
||||
@ -92,11 +93,11 @@ export class AccountService {
|
||||
);
|
||||
}
|
||||
|
||||
balance(id: string, date: string): Observable<any> {
|
||||
balance(id: string, date: string): Observable<AccountBalance> {
|
||||
const options = { params: new HttpParams().set('d', date) };
|
||||
return <Observable<any>>(
|
||||
return <Observable<AccountBalance>>(
|
||||
this.http
|
||||
.get<any>(`${url}/${id}/balance`, options)
|
||||
.get<AccountBalance>(`${url}/${id}/balance`, options)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'balance')))
|
||||
);
|
||||
}
|
||||
|
||||
@ -19,7 +19,7 @@ export class ErrorLoggerService {
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars, class-methods-use-this
|
||||
public handleError<T>(serviceName = 'error-logger', operation = 'operation', result?: T) {
|
||||
return (error: any): Observable<T> => {
|
||||
return (error: unknown): Observable<T> => {
|
||||
ErrorLoggerService.log(serviceName, `${operation} failed: ${error}`);
|
||||
return throwError(error);
|
||||
};
|
||||
|
||||
@ -19,7 +19,7 @@ export class ErrorInterceptor implements HttpInterceptor {
|
||||
private toaster: ToasterService,
|
||||
) {}
|
||||
|
||||
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
|
||||
intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {
|
||||
return next.handle(request).pipe(
|
||||
catchError((err) => {
|
||||
// We don't want to refresh token for some requests like login or refresh token itself
|
||||
|
||||
14
overlord/src/app/core/issue-grid-item.ts
Normal file
14
overlord/src/app/core/issue-grid-item.ts
Normal file
@ -0,0 +1,14 @@
|
||||
export class IssueGridItem {
|
||||
id: string;
|
||||
amount: number;
|
||||
source: string;
|
||||
destination: string;
|
||||
|
||||
public constructor(init?: Partial<IssueGridItem>) {
|
||||
this.id = '';
|
||||
this.amount = 0;
|
||||
this.source = '';
|
||||
this.destination = '';
|
||||
Object.assign(this, init);
|
||||
}
|
||||
}
|
||||
@ -10,7 +10,7 @@ export class JwtInterceptor implements HttpInterceptor {
|
||||
|
||||
constructor(private authService: AuthService) {}
|
||||
|
||||
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
|
||||
intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {
|
||||
// add authorization header with jwt token if available
|
||||
|
||||
// We use this line to debug token refreshing
|
||||
|
||||
Reference in New Issue
Block a user