Fully working with the rule no explicit any
This commit is contained in:
@ -3,9 +3,8 @@ import { Product } from './product';
|
||||
import { Tax } from './tax';
|
||||
|
||||
export class BillViewItem {
|
||||
id: string;
|
||||
id: string | undefined;
|
||||
isKot: boolean;
|
||||
oldKot: boolean;
|
||||
info: string;
|
||||
|
||||
kotId: string;
|
||||
@ -20,10 +19,16 @@ export class BillViewItem {
|
||||
tax: Tax;
|
||||
modifiers: Modifier[];
|
||||
|
||||
public get isOldKot(): boolean {
|
||||
return this.isKot && this.id !== undefined;
|
||||
}
|
||||
|
||||
public get isNewKot(): boolean {
|
||||
return this.isKot && this.id === undefined;
|
||||
}
|
||||
|
||||
public constructor(init?: Partial<BillViewItem>) {
|
||||
this.id = '';
|
||||
this.isKot = true;
|
||||
this.oldKot = false;
|
||||
this.info = '';
|
||||
this.kotId = '';
|
||||
this.product = new Product();
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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