@@ -4,15 +4,19 @@ import {
44 Injectable ,
55 NestInterceptor ,
66 BadRequestException ,
7+ Logger ,
78} from '@nestjs/common' ;
89import { Observable } from 'rxjs' ;
910import { MinioService } from '../minio.service' ;
1011import { map } from 'rxjs/operators' ;
1112
1213@Injectable ( )
1314export class MinioFileInterceptor implements NestInterceptor {
15+ private readonly logger = new Logger ( MinioFileInterceptor . name ) ;
16+
1417 constructor ( private readonly minioService : MinioService ) { }
1518
19+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1620 intercept ( context : ExecutionContext , next : CallHandler ) : Observable < any > {
1721 const request = context . switchToHttp ( ) . getRequest ( ) ;
1822 const files = request . files || { } ;
@@ -90,6 +94,7 @@ export class MinioFileInterceptor implements NestInterceptor {
9094 } ) ;
9195 }
9296
97+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9398 private async transformUrls ( data : any ) : Promise < any > {
9499 if ( ! data ) return data ;
95100
@@ -104,7 +109,7 @@ export class MinioFileInterceptor implements NestInterceptor {
104109 try {
105110 obj [ key ] = await this . minioService . getPresignedUrl ( bucketName , pathParts . join ( '/' ) ) ;
106111 } catch ( error ) {
107- console . error ( `Error generating presigned URL for ${ key } :` , error ) ;
112+ this . logger . error ( `Error generating presigned URL for ${ key } :` , error ) ;
108113 }
109114 }
110115 }
@@ -113,7 +118,8 @@ export class MinioFileInterceptor implements NestInterceptor {
113118 return obj ;
114119 }
115120
116- private validateFile ( file : any , config : any ) {
121+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
122+ private validateFile ( file : any , config : any ) : void {
117123 // Get validation metadata from both decorators
118124 const validationConfig = {
119125 allowedMimeTypes : config . allowedMimeTypes || [ ] ,
0 commit comments