Skip to content

Commit 8235a03

Browse files
bugfix(@nestjs/common) FileInterceptor overrides multiple options
1 parent 03216d2 commit 8235a03

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/common/interceptors/file.interceptor.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ import * as multer from 'multer';
22
import { NestInterceptor } from './../interfaces/nest-interceptor.interface';
33
import { Observable } from 'rxjs/Observable';
44
import { MulterOptions } from '../interfaces/external/multer-options.interface';
5+
import { mixin } from '../decorators/core/component.decorator';
56

67
export function FileInterceptor(fieldName: string, options?: MulterOptions) {
7-
const Interceptor = class implements NestInterceptor {
8+
return mixin(class implements NestInterceptor {
89
readonly upload = multer(options);
910

1011
async intercept(
@@ -17,6 +18,5 @@ export function FileInterceptor(fieldName: string, options?: MulterOptions) {
1718
);
1819
return stream$;
1920
}
20-
};
21-
return Interceptor;
21+
});
2222
}

0 commit comments

Comments
 (0)