chore: add danak services and admin login
This commit is contained in:
@@ -3,8 +3,8 @@ import slugify from "slugify";
|
||||
import { Not } from "typeorm";
|
||||
|
||||
import { RoleRepository } from "./roles.repository";
|
||||
import { UserRepository } from "./users.repository";
|
||||
import { roles } from "../../../../database/seeders/role.seeder";
|
||||
import { UserRepository } from "../repositories/users.repository";
|
||||
// import { roles } from "../../../../database/seeders/role.seeder";
|
||||
import { CommonMessage, UserMessage } from "../../../common/enums/message.enum";
|
||||
import { CompleteRegistrationDto } from "../../auth/DTO/complete-register.dto";
|
||||
import { CheckValidityDTO } from "../DTO/check-validity.dto";
|
||||
@@ -38,6 +38,7 @@ export class UsersService {
|
||||
/************************************************************ */
|
||||
|
||||
async getMe(userId: string) {
|
||||
this.logger.debug("sss");
|
||||
const user = await this.userRepository.findOne({ where: { id: userId }, select: this.userSelect });
|
||||
if (!user) throw new BadRequestException(UserMessage.USER_NOT_FOUND);
|
||||
return { user };
|
||||
@@ -105,11 +106,11 @@ export class UsersService {
|
||||
}
|
||||
|
||||
///****************************************************** */
|
||||
async roleSeeder() {
|
||||
const countRole = await this.roleRepository.count();
|
||||
if (countRole > 0) return;
|
||||
const createdRoles = await this.roleRepository.insert(roles);
|
||||
this.logger.log({ createdRoles });
|
||||
return createdRoles;
|
||||
}
|
||||
// async roleSeeder() {
|
||||
// const countRole = await this.roleRepository.count();
|
||||
// if (countRole > 0) return;
|
||||
// const createdRoles = await this.roleRepository.insert(roles);
|
||||
// this.logger.log({ createdRoles });
|
||||
// return createdRoles;
|
||||
// }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user