fix: fix null assertion in creating junior

This commit is contained in:
Abdalhameed Ahmad
2025-08-24 20:14:59 +03:00
parent 4552a7fc93
commit 7dd309e0e3

View File

@ -60,12 +60,12 @@ export class JuniorService {
await this.juniorRepository.createJunior(user.id, { await this.juniorRepository.createJunior(user.id, {
guardianId, guardianId,
relationship: body.relationship, relationship: body.relationship,
customerId: childCustomer.id, customerId: childCustomer!.id,
}); });
this.logger.debug('Creating card For Child'); this.logger.debug('Creating card For Child');
await this.cardService.createCardForChild(parentCustomer, childCustomer, body.cardColor, body.cardColor); await this.cardService.createCardForChild(parentCustomer, childCustomer!, body.cardColor, body.cardColor);
this.logger.log(`Junior ${user.id} created successfully`); this.logger.log(`Junior ${user.id} created successfully`);
return this.generateToken(user.id); return this.generateToken(user.id);