diff --git a/src/createEmployeeAccount.c b/src/createEmployeeAccount.c index f8668bd..308b390 100644 --- a/src/createEmployeeAccount.c +++ b/src/createEmployeeAccount.c @@ -179,11 +179,17 @@ void getNewEmployeeCredentials() printf("\n\nplease enter your Phone number\n"); scanf(" %[^\n]s",data->phoneNumber); - - createNewEmployee(employeeId,employeePassword) ? - printf("\n\n Account created successfully !\n\n") : - printf("\n\n Could not create the Account please contact an employee of clearance 1 !\n\n"); - storeEmployeeData(data->firstName,data->lastName,data->address,data->phoneNumber); + if(isValidPhoneNumber(data->phoneNumber)) + { + createNewEmployee(employeeId,employeePassword) ? + printf("\n\n Account created successfully !\n\n") : + printf("\n\n Could not create the Account please contact an employee of clearance 1 !\n\n"); + storeEmployeeData(data->firstName,data->lastName,data->address,data->phoneNumber); + } + else + { + printf("\nInvalid phone number!\n"); + } } else {