import { createParamDecorator , ExecutionContext } from '@nestjs/common' ; import { JwtPayload } from '../../auth/types' ; export const GetCurrentUserId = createParamDecorator ( ( _ , context ) : number => { const request = context . switchToHttp ( ) . getRequest ( ) ; const user = request . user as JwtPayload ; return user . sub ; } ) ;