mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-08-25 13:49:40 +00:00
fix: fix issue with customer relationship in creating junior
This commit is contained in:
@ -30,10 +30,13 @@ export class CustomerService {
|
|||||||
return this.findCustomerById(userId);
|
return this.findCustomerById(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
createJuniorCustomer(guardianId: string, juniorId: string, body: CreateJuniorRequestDto) {
|
async createJuniorCustomer(guardianId: string, juniorId: string, body: CreateJuniorRequestDto) {
|
||||||
this.logger.log(`Creating junior customer for user ${juniorId}`);
|
this.logger.log(`Creating junior customer for user ${juniorId}`);
|
||||||
|
|
||||||
return this.customerRepository.createCustomer(juniorId, body, false);
|
await this.customerRepository.createCustomer(juniorId, body, false);
|
||||||
|
|
||||||
|
this.logger.log(`Junior customer created for user ${juniorId} successfully`);
|
||||||
|
return this.customerRepository.findOne({ id: juniorId });
|
||||||
}
|
}
|
||||||
|
|
||||||
async findCustomerById(id: string) {
|
async findCustomerById(id: string) {
|
||||||
|
Reference in New Issue
Block a user