import { CallHandler, ExecutionContext, Injectable, NestInterceptor, } from '@nestjs/common'; import { ClsService } from 'nestjs-cls'; import { Observable } from 'rxjs'; @Injectable() export class TenancyIdClsInterceptor implements NestInterceptor { constructor(private readonly cls: ClsService) {} intercept(context: ExecutionContext, next: CallHandler): Observable { const request = context.switchToHttp().getRequest(); const organizationId = request.headers['organization-id']; // this.cls.get('organizationId'); // console.log(organizationId, 'organizationId22'); return next.handle(); } }