1
0
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:
Jared Snider 2024-06-14 13:49:27 -04:00 committed by GitHub
parent 44b5971458
commit a95ca524c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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