refactor: the whole role and permission flow
This commit is contained in:
@@ -21,7 +21,7 @@ export const seedAdmin = async (dataSource: DataSource, logger: Logger) => {
|
||||
const roleRepo = dataSource.getRepository(Role);
|
||||
const userRepo = dataSource.getRepository(User);
|
||||
|
||||
const adminRole = await roleRepo.findOneBy({ name: RoleEnum.ADMIN });
|
||||
const adminRole = await roleRepo.findOneBy({ name: RoleEnum.SUPER_ADMIN });
|
||||
if (!adminRole) throw new Error("Role not found");
|
||||
|
||||
const hashedPassword = await hash(defaultAdmin.password!, 10);
|
||||
|
||||
Reference in New Issue
Block a user