mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-22 16:29:09 +01:00
PM-8866 - Fix Recover delete component submit missing form validation. (#9658)
This commit is contained in:
parent
44b5971458
commit
a95ca524c6
@ -13,9 +13,13 @@ import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/pl
|
||||
})
|
||||
export class RecoverDeleteComponent {
|
||||
protected recoverDeleteForm = new FormGroup({
|
||||
email: new FormControl(null, [Validators.required]),
|
||||
email: new FormControl("", [Validators.required]),
|
||||
});
|
||||
|
||||
get email() {
|
||||
return this.recoverDeleteForm.controls.email;
|
||||
}
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
private apiService: ApiService,
|
||||
@ -24,8 +28,12 @@ export class RecoverDeleteComponent {
|
||||
) {}
|
||||
|
||||
submit = async () => {
|
||||
if (this.recoverDeleteForm.invalid) {
|
||||
return;
|
||||
}
|
||||
|
||||
const request = new DeleteRecoverRequest();
|
||||
request.email = this.recoverDeleteForm.value.email.trim().toLowerCase();
|
||||
request.email = this.email.value.trim().toLowerCase();
|
||||
await this.apiService.postAccountRecoverDelete(request);
|
||||
this.platformUtilsService.showToast(
|
||||
"success",
|
||||
|
Loading…
Reference in New Issue
Block a user