fix: eslint problem

This commit is contained in:
mahyargdz
2025-04-14 16:45:01 +03:30
parent bec73658d5
commit 167cb15e32
8 changed files with 15 additions and 11 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ export class HttpExceptionFilter implements ExceptionFilter {
});
}
private extractMessage(response: string | Record<string, any>): string | string[] {
private extractMessage(response: string | object): string | string[] {
if (typeof response === "string") {
return [response];
}
@@ -8,12 +8,12 @@ import { IPageFormat } from "../../common/interfaces/IPagination";
export class PaginationInterceptor implements NestInterceptor {
private readonly logger = new Logger(PaginationInterceptor.name);
intercept(context: ExecutionContext, next: CallHandler): Observable<any> {
intercept(context: ExecutionContext, next: CallHandler): Observable<unknown> {
const request = context.switchToHttp().getRequest<FastifyRequest>();
const query = request.query as any;
const query = request.query as { page: string; limit: string };
const page = parseInt(query.page as string, 10) || 1;
const limit = parseInt(query.limit as string, 10) || 10;
const page = parseInt(query.page, 10) || 1;
const limit = parseInt(query.limit, 10) || 10;
const className = context.getClass().name;
const handlerName = context.getHandler().name;
+5 -5
View File
@@ -26,18 +26,18 @@ export class LoggerService extends Logger {
}
}
override log(message: any) {
this.sendLogToTelegram("test", message);
override log(message: unknown) {
this.sendLogToTelegram("test", message as string);
super.log(message);
}
override error(message: any, trace?: any) {
override error(message: unknown, trace?: unknown) {
super.error(message, trace);
this.sendLogToTelegram("error", `${message}\nTrace: ${trace}`);
}
override warn(message: any) {
override warn(message: unknown) {
super.warn(message);
this.sendLogToTelegram("warn", message);
this.sendLogToTelegram("warn", message as string);
}
}
@@ -1,3 +1,4 @@
// eslint-disable-next-line import/no-named-as-default
import Decimal from "decimal.js";
import { Column, Entity, ManyToOne, OneToMany } from "typeorm";
@@ -1,3 +1,4 @@
// eslint-disable-next-line import/no-named-as-default
import Decimal from "decimal.js";
import { Column, Entity, ManyToOne } from "typeorm";
@@ -1,6 +1,7 @@
import { randomBytes } from "node:crypto";
import { BadRequestException, Injectable } from "@nestjs/common";
// eslint-disable-next-line import/no-named-as-default
import Decimal from "decimal.js";
import { DataSource, QueryRunner } from "typeorm";
@@ -1,5 +1,6 @@
import { BadRequestException, Injectable } from "@nestjs/common";
import dayjs from "dayjs";
// eslint-disable-next-line import/no-named-as-default
import Decimal from "decimal.js";
import { DataSource, In, Not } from "typeorm";
@@ -206,7 +206,7 @@ export class CustomersService {
if (!addressEntity) throw new BadRequestException(UserMessage.ADDRESS_NOT_FOUND);
// Prepare address updates
const addressUpdates: any = {};
const addressUpdates: Record<string, unknown> = {};
if (cityId) {
const { city } = await this.addressService.getCity(+cityId);