fix: bug in the sliders and blog module

This commit is contained in:
mahyargdz
2025-04-13 10:30:59 +03:30
parent cac2620fc6
commit 78f481871c
14 changed files with 219 additions and 10 deletions
@@ -243,8 +243,11 @@ export class UsersService {
const existUser = await queryRunner.manager.findOneBy(User, { nationalCode: registerDto.nationalCode });
if (existUser) throw new BadRequestException(UserMessage.NATIONAL_CODE_EXIST);
const userName = slugify(`${registerDto.firstName} ${Date.now().toString().slice(-5)}`, { lower: true, trim: true });
const user = queryRunner.manager.create(User, {
...registerDto,
userName,
password: hashedPassword,
roles: [role],
});