refactor: change the role to roles and many to many

This commit is contained in:
mahyargdz
2025-02-16 16:58:51 +03:30
parent 9cdd7ef28e
commit ad673613d9
32 changed files with 264 additions and 88 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ export const seedAdmin = async (dataSource: DataSource, logger: Logger) => {
const hashedPassword = await hash(defaultAdmin.password!, 10);
const admin = userRepo.create({ ...defaultAdmin, password: hashedPassword, role: adminRole });
const admin = userRepo.create({ ...defaultAdmin, password: hashedPassword, roles: [adminRole] });
await userRepo.save(admin);
logger.log("admin created successfully");
} catch (error) {