import { CallHandler , ExecutionContext , Injectable , NestInterceptor } from '@nestjs/common' ; import { Observable } from 'rxjs' ; import { map } from 'rxjs/operators' ; @ Injectable ( ) export class WrapInterceptor implements NestInterceptor { intercept ( context , next ) { return next . handle ( ) . pipe ( map ( ( response ) => ( { status : 'success' , data : response } ) ) ) ; } }