frontend redesign, implementing tailwind accross app, added shared component

This commit is contained in:
Dimitar765 committed 2024-10-29 12:30:33 +01:00
1 parent 1a7f2afd79
commit ce893a4185
15 files changed
+1030 -570

No files matched your search

+27 -3
View File
@@ -126,12 +126,36 @@ export class AdminService {
});
}
async createUser(createUserDto: CreateUserDto) {
const hashedPassword = await bcrypt.hash(createUserDto.password, 10);
// async createUser(createUserDto: CreateUserDto) {
// const hashedPassword = await bcrypt.hash(createUserDto.password, 10);
// return this.prisma.user.create({
// data: {
// ...createUserDto,
// password: hashedPassword,
// },
// });
// }
async createUser(userData: {
name: string;
email: string;
password: string;
isAdmin: boolean;
}) {
const hashedPassword = await bcrypt.hash(userData.password, 10);
return this.prisma.user.create({
data: {
...createUserDto,
name: userData.name,
email: userData.email,
password: hashedPassword,
isAdmin: userData.isAdmin,
},
select: {
id: true,
name: true,
email: true,
isAdmin: true,
},
});
}
@@ -1,4 +1,4 @@
import { IsString, IsEmail, MinLength } from 'class-validator';
import { IsString, IsEmail, MinLength, IsBoolean } from 'class-validator';
export class CreateUserDto {
@IsString()
@@ -10,4 +10,7 @@ export class CreateUserDto {
@IsString()
@MinLength(6)
password: string;
@IsBoolean()
isAdmin: boolean = false;
}