mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-08-25 13:49:40 +00:00
add login flow for waiting list demo app
This commit is contained in:
@ -98,7 +98,7 @@ export class CustomerService {
|
||||
throw new BadRequestException('CUSTOMER.ALRADY_EXISTS');
|
||||
}
|
||||
|
||||
await this.validateCivilIdForCustomer(userId, body.civilIdFrontId, body.civilIdBackId);
|
||||
// await this.validateCivilIdForCustomer(userId, body.civilIdFrontId, body.civilIdBackId);
|
||||
|
||||
const customer = await this.customerRepository.createCustomer(userId, body, true);
|
||||
this.logger.log(`customer created for user ${userId}`);
|
||||
@ -166,9 +166,12 @@ export class CustomerService {
|
||||
throw new BadRequestException('CUSTOMER.CIVIL_ID_NOT_CREATED_BY_USER');
|
||||
}
|
||||
|
||||
const customerWithTheSameId = await this.customerRepository.findCustomerByCivilId(civilIdFrontId, civilIdBackId);
|
||||
const customerWithTheSameCivilId = await this.customerRepository.findCustomerByCivilId(
|
||||
civilIdFrontId,
|
||||
civilIdBackId,
|
||||
);
|
||||
|
||||
if (customerWithTheSameId) {
|
||||
if (customerWithTheSameCivilId) {
|
||||
this.logger.error(
|
||||
`Customer with civil id front ${civilIdFrontId} and civil id back ${civilIdBackId} already exists`,
|
||||
);
|
||||
|
Reference in New Issue
Block a user