Skip to content

Commit

Permalink
add logger to registrationPin deleteService
Browse files Browse the repository at this point in the history
  • Loading branch information
WojciechGrancow committed Dec 29, 2023
1 parent 80d8bd5 commit 64830b3
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import { Injectable } from '@nestjs/common';
import { LegacyLogger } from '@src/core/logger';
import { RegistrationPinRepo } from '../repo';

@Injectable()
export class RegistrationPinService {
constructor(private readonly registrationPinRepo: RegistrationPinRepo) {}
constructor(private readonly registrationPinRepo: RegistrationPinRepo, private readonly logger: LegacyLogger) {
this.logger.setContext(RegistrationPinService.name);
}

async deleteRegistrationPinByEmail(email: string): Promise<number> {
return this.registrationPinRepo.deleteRegistrationPinByEmail(email);
this.logger.log({ action: 'Deleting registrationPin for ', email });
const result = this.registrationPinRepo.deleteRegistrationPinByEmail(email);
this.logger.log({ action: 'Deleted registrationPin for ', email });

return result;
}
}

0 comments on commit 64830b3

Please sign in to comment.