mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 22:30:31 +00:00
24 lines
637 B
TypeScript
24 lines
637 B
TypeScript
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<any> {
|
|
const request = context.switchToHttp().getRequest();
|
|
const organizationId = request.headers['organization-id'];
|
|
// this.cls.get('organizationId');
|
|
|
|
// console.log(organizationId, 'organizationId22');
|
|
|
|
return next.handle();
|
|
}
|
|
}
|