Transfer repository from Gitlab

This commit is contained in:
Tran, Alex
2022-02-03 10:06:44 -06:00
parent af2efbdbbd
commit 568cc243f0
177 changed files with 13300 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
import { createParamDecorator, ExecutionContext } from '@nestjs/common';
import { UserEntity } from '../api-v1/user/entities/user.entity';
// import { AuthUserDto } from './dto/auth-user.dto';
export class AuthUserDto {
id: string;
email: string;
}
export const GetAuthUser = createParamDecorator((data, ctx: ExecutionContext): AuthUserDto => {
const req = ctx.switchToHttp().getRequest();
const { id, email } = req.user as UserEntity;
const authUser: any = {
id: id.toString(),
email,
};
return authUser;
});