diff --git a/src/shared/modules/user/user.entity.ts b/src/shared/modules/user/user.entity.ts index 13fc9fc..e21cee0 100644 --- a/src/shared/modules/user/user.entity.ts +++ b/src/shared/modules/user/user.entity.ts @@ -1,4 +1,4 @@ -import {setLogLevel, defaultClasses, getModelForClass, modelOptions} from '@typegoose/typegoose'; +import {setLogLevel, defaultClasses, getModelForClass, modelOptions, prop} from '@typegoose/typegoose'; import { User } from '../../types/index.js'; import {createSHA256} from '../../helpers/index.js'; @@ -16,6 +16,8 @@ export interface UserEntity extends defaultClasses.Base {} }) // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging export class UserEntity extends defaultClasses.TimeStamps implements User { + + @prop({unique: true, default: ''}) public name: string; public avatarUrl: string;