10 lines
338 B
TypeScript
10 lines
338 B
TypeScript
|
import { createParamDecorator, ExecutionContext } from '@nestjs/common';
|
||
|
import { CachedZone } from 'src/types/dns.interfaces';
|
||
|
|
||
|
export const ReqCachedZone = createParamDecorator(
|
||
|
(data: unknown, ctx: ExecutionContext) => {
|
||
|
const response = ctx.switchToHttp().getResponse();
|
||
|
return response.locals.cached as CachedZone;
|
||
|
},
|
||
|
);
|