ccc
This commit is contained in:
@@ -17,11 +17,20 @@ export class UsernameValidator {
|
||||
return new Promise(resolve => {
|
||||
this.debouncer = setTimeout(() => {
|
||||
this.registrationService.validateUserName(control.value).subscribe((res) => {
|
||||
console.log(res.users.length)
|
||||
if(res.users.length === 0){
|
||||
resolve(null);
|
||||
}else{
|
||||
resolve({'usernameInUse': true});
|
||||
}
|
||||
/*
|
||||
if(res.ok){
|
||||
resolve(null);
|
||||
}
|
||||
}, (err) => {
|
||||
resolve({'usernameInUse': true});
|
||||
*/
|
||||
|
||||
});
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user