email exit validation added
This commit is contained in:
parent
433f7d4cb4
commit
cb618c61a6
@ -87,6 +87,12 @@ export class AddBusinessComponent implements OnInit {
|
|||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
}
|
}
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
let valData;
|
||||||
|
if(this.action == 'Add'){
|
||||||
|
valData= [this.validateUsernameAvailability.bind(this)]
|
||||||
|
}else{
|
||||||
|
valData = null
|
||||||
|
}
|
||||||
let userrole = localStorage.getItem('user_role')
|
let userrole = localStorage.getItem('user_role')
|
||||||
this.form = new FormGroup({
|
this.form = new FormGroup({
|
||||||
admin_checked: new FormControl('',null),
|
admin_checked: new FormControl('',null),
|
||||||
@ -98,7 +104,7 @@ export class AddBusinessComponent implements OnInit {
|
|||||||
state: new FormControl('', [Validators.required]),
|
state: new FormControl('', [Validators.required]),
|
||||||
email: new FormControl('', [Validators.required, Validators.email,Validators.pattern(
|
email: new FormControl('', [Validators.required, Validators.email,Validators.pattern(
|
||||||
'[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,63}$',
|
'[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,63}$',
|
||||||
),],[this.validateUsernameAvailability.bind(this)]),
|
),],valData),
|
||||||
contactNo: new FormControl('', [Validators.required, Validators.minLength(10),Validators.maxLength(10)]),
|
contactNo: new FormControl('', [Validators.required, Validators.minLength(10),Validators.maxLength(10)]),
|
||||||
createdBy:new FormControl(userrole,[Validators.required]),
|
createdBy:new FormControl(userrole,[Validators.required]),
|
||||||
});
|
});
|
||||||
@ -122,7 +128,7 @@ export class AddBusinessComponent implements OnInit {
|
|||||||
tmp.push(element.email)
|
tmp.push(element.email)
|
||||||
});
|
});
|
||||||
console.log(tmp,`${control.value}`);
|
console.log(tmp,`${control.value}`);
|
||||||
return !tmp.includes(`${control.value}` && this.action == 'add') ? null : { usernameTaken: true };
|
return !tmp.includes(`${control.value}`) ? null : { usernameTaken: true };
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -57,6 +57,12 @@ export class AddUserComponent implements OnInit {
|
|||||||
|
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
let valData;
|
||||||
|
if(this.action == 'Add'){
|
||||||
|
valData= [this.validateUsernameAvailability.bind(this)]
|
||||||
|
}else{
|
||||||
|
valData = null
|
||||||
|
}
|
||||||
this.hide = true;
|
this.hide = true;
|
||||||
this.disableBus = localStorage.getItem('go_admin')
|
this.disableBus = localStorage.getItem('go_admin')
|
||||||
this.userrole = localStorage.getItem('user_role')
|
this.userrole = localStorage.getItem('user_role')
|
||||||
@ -69,7 +75,7 @@ export class AddUserComponent implements OnInit {
|
|||||||
// lastName: new FormControl('', [Validators.required, Validators.maxLength(20)]),
|
// lastName: new FormControl('', [Validators.required, Validators.maxLength(20)]),
|
||||||
email: new FormControl('', [Validators.required, Validators.email,Validators.pattern(
|
email: new FormControl('', [Validators.required, Validators.email,Validators.pattern(
|
||||||
'[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,63}$',
|
'[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,63}$',
|
||||||
),],[this.validateUsernameAvailability.bind(this)]),
|
),],valData),
|
||||||
// password: new FormControl('', [Validators.required, Validators.minLength(6)]),
|
// password: new FormControl('', [Validators.required, Validators.minLength(6)]),
|
||||||
password: new FormControl('', [Validators.required,Validators.pattern(
|
password: new FormControl('', [Validators.required,Validators.pattern(
|
||||||
'^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*_=+-]).{8,12}$'
|
'^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*_=+-]).{8,12}$'
|
||||||
|
|||||||
@ -18,6 +18,7 @@ export class BookingSummaryComponent implements OnInit {
|
|||||||
summary:any= false;
|
summary:any= false;
|
||||||
busName: any;
|
busName: any;
|
||||||
logo: any;
|
logo: any;
|
||||||
|
currency:any =[];
|
||||||
private apiUrl = environment.apiEndpoint;
|
private apiUrl = environment.apiEndpoint;
|
||||||
customerBookingDetails: any = [];
|
customerBookingDetails: any = [];
|
||||||
constructor(public end_user:EndUserService,private router:Router,) {
|
constructor(public end_user:EndUserService,private router:Router,) {
|
||||||
@ -41,6 +42,7 @@ export class BookingSummaryComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
this.currency = localStorage.getItem('currency')
|
||||||
this.end_user.summmarylist_observable$.subscribe((res) => {
|
this.end_user.summmarylist_observable$.subscribe((res) => {
|
||||||
console.log('booked2', res);
|
console.log('booked2', res);
|
||||||
this.customerBookingDetails = res[0].customer[0]
|
this.customerBookingDetails = res[0].customer[0]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user