添加一个转换数据的拦截器,nest generate interceptor transform core/interceptors
This commit is contained in:
parent
3a04b50060
commit
ad0359f4f4
|
@ -0,0 +1,7 @@
|
|||
import { TransformInterceptor } from './transform.interceptor';
|
||||
|
||||
describe('TransformInterceptor', () => {
|
||||
it('should be defined', () => {
|
||||
expect(new TransformInterceptor()).toBeDefined();
|
||||
});
|
||||
});
|
|
@ -0,0 +1,9 @@
|
|||
import { CallHandler, ExecutionContext, Injectable, NestInterceptor } from '@nestjs/common';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
@Injectable()
|
||||
export class TransformInterceptor implements NestInterceptor {
|
||||
intercept(context: ExecutionContext, next: CallHandler): Observable<any> {
|
||||
return next.handle();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue