import { createParamDecorator , ExecutionContext } from '@nestjs/common' ; import { UserEntity } from '@admin/access/users/user.entity' ; export const CurrentUser = createParamDecorator < UserEntity > ( ( data , ctx ) => { const request = ctx . switchToHttp ( ) . getRequest ( ) ; return request . user ; } ) ;