File tree Expand file tree Collapse file tree
packages/common/interceptors Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import * as multer from 'multer' ;
22import { Observable } from 'rxjs' ;
3+ import { mixin } from '../decorators/core/component.decorator' ;
34import { ExecutionContext } from '../interfaces' ;
45import { MulterField , MulterOptions } from '../interfaces/external/multer-options.interface' ;
56import { NestInterceptor } from './../interfaces/features/nest-interceptor.interface' ;
@@ -9,7 +10,7 @@ export function FileFieldsInterceptor(
910 uploadFields : MulterField [ ] ,
1011 options ?: MulterOptions ,
1112) {
12- const Interceptor = class implements NestInterceptor {
13+ const Interceptor = mixin ( class implements NestInterceptor {
1314 readonly upload = multer ( options ) ;
1415
1516 async intercept (
@@ -33,6 +34,6 @@ export function FileFieldsInterceptor(
3334 ) ;
3435 return call$ ;
3536 }
36- } ;
37+ } ) ;
3738 return Interceptor ;
3839}
Original file line number Diff line number Diff line change 11import * as multer from 'multer' ;
2- import { NestInterceptor } from './../interfaces/features/nest-interceptor.interface' ;
32import { Observable } from 'rxjs' ;
3+ import { mixin } from '../decorators/core/component.decorator' ;
4+ import { ExecutionContext } from '../interfaces' ;
45import { MulterOptions } from '../interfaces/external/multer-options.interface' ;
6+ import { NestInterceptor } from './../interfaces/features/nest-interceptor.interface' ;
57import { transformException } from './multer/multer.utils' ;
6- import { ExecutionContext } from '../interfaces' ;
78
89export function FilesInterceptor (
910 fieldName : string ,
1011 maxCount ?: number ,
1112 options ?: MulterOptions ,
1213) {
13- const Interceptor = class implements NestInterceptor {
14+ const Interceptor = mixin ( class implements NestInterceptor {
1415 readonly upload = multer ( options ) ;
1516
1617 async intercept (
@@ -34,6 +35,6 @@ export function FilesInterceptor(
3435 ) ;
3536 return call$ ;
3637 }
37- } ;
38+ } ) ;
3839 return Interceptor ;
3940}
Original file line number Diff line number Diff line change 1- import { Get , Controller , Render } from '@nestjs/common' ;
1+ import { Controller , Get , Render } from '@nestjs/common' ;
22
33@Controller ( )
44export class AppController {
You can’t perform that action at this time.
0 commit comments