frontend redesign, implementing tailwind accross app, added shared component
This commit is contained in:
1 parent
1a7f2afd79
commit
ce893a4185
15 files changed
+1030
-570
No files matched your search
@@ -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;
|
||||
}
|
||||
Reference in new issue
Block a user