mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2026-10-25 15:37:56 +00:00
refactor: remove unsed code
This commit is contained in:
@@ -7,9 +7,9 @@ export class UserTokenService {
|
||||
constructor(private readonly userTokenRepository: UserTokenRepository) {}
|
||||
private readonly logger = new Logger(UserTokenService.name);
|
||||
|
||||
async generateToken(userId: string, userType: UserType, expiryDate?: Date): Promise<string> {
|
||||
async generateToken(userId: string, expiryDate?: Date): Promise<string> {
|
||||
this.logger.log(`Generating token for user ${userId}`);
|
||||
const tokenEntity = await this.userTokenRepository.generateToken(userId, userType, expiryDate);
|
||||
const tokenEntity = await this.userTokenRepository.generateToken(userId, expiryDate);
|
||||
this.logger.log(`Token generated successfully for junior ${userId}`);
|
||||
return tokenEntity.token;
|
||||
}
|
||||
@@ -29,7 +29,7 @@ export class UserTokenService {
|
||||
}
|
||||
|
||||
this.logger.log(`Token validated successfully`);
|
||||
return tokenEntity.juniorId! || tokenEntity.userId!;
|
||||
return tokenEntity.userId!;
|
||||
}
|
||||
|
||||
invalidateToken(token: string) {
|
||||
|
||||
@@ -154,7 +154,7 @@ export class UserService {
|
||||
isProfileCompleted: true,
|
||||
});
|
||||
const ONE_DAY = moment().add(1, 'day').toDate();
|
||||
const token = await this.userTokenService.generateToken(user.id, UserType.CHECKER, ONE_DAY);
|
||||
const token = await this.userTokenService.generateToken(user.id, ONE_DAY);
|
||||
await this.sendCheckerAccountCreatedEmail(data.email, token);
|
||||
|
||||
return user;
|
||||
|
||||
Reference in New Issue
Block a user