1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-14 23:33:31 +00:00

PM-8866 - Fix Recover delete component submit missing form validation. (#9658)

This commit is contained in:
Jared Snider
2024-06-14 13:49:27 -04:00
committed by GitHub
parent 44b5971458
commit a95ca524c6

View File

@@ -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",