SES-114 Adder Errors to register view and user can no longer register with two different passwords #40
@ -6,7 +6,6 @@ import {Subscription} from 'rxjs';
|
|||||||
import {ErrorResponse} from '../../../types/ErrorResponse';
|
import {ErrorResponse} from '../../../types/ErrorResponse';
|
||||||
import {UserRegisterViewModel} from '../../../types/viewmodels/user-viewmodels/UserRegisterViewModel';
|
import {UserRegisterViewModel} from '../../../types/viewmodels/user-viewmodels/UserRegisterViewModel';
|
||||||
import {HttpErrorResponse} from '@angular/common/http';
|
import {HttpErrorResponse} from '@angular/common/http';
|
||||||
import {type} from 'os';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-registration',
|
selector: 'app-registration',
|
||||||
@ -36,6 +35,7 @@ export class RegistrationComponent implements OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Register() {
|
Register() {
|
||||||
|
if (this.signUpFormGroup.valid) {
|
||||||
const userRegisterModel = new class implements UserRegisterViewModel {
|
const userRegisterModel = new class implements UserRegisterViewModel {
|
||||||
password: string;
|
password: string;
|
||||||
username: string;
|
username: string;
|
||||||
@ -57,6 +57,11 @@ export class RegistrationComponent implements OnDestroy {
|
|||||||
this.apiErrorMessage = error.message;
|
this.apiErrorMessage = error.message;
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
} else {
|
||||||
|
this.signUpFormGroup.get('newAccount').get('username').markAsTouched();
|
||||||
|
this.signUpFormGroup.get('newAccount').get('password').markAsTouched();
|
||||||
|
this.signUpFormGroup.get('newAccount').get('confirmPassword').markAsTouched();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
|
Loading…
Reference in New Issue
Block a user