refactor(rep-create-form.component): Erstellung gestoppt, wenn das Formular nicht gültig ist

This commit is contained in:
Developer 02 2024-11-08 16:27:41 +01:00
parent 7316343658
commit 371967380b

View File

@ -68,14 +68,17 @@ export class RepCreateFormComponent implements OnInit {
create() {
const validFrom = this.range.value.start;
const validTo = this.range.value.end;
if (!validFrom || !validTo)
if (!validFrom || !validTo) {
Swal.fire({
icon: "error",
title: "Oops...",
text: "Bitte geben Sie einen gültigen Datumsbereich ein!",
});
return;
}
this.userRep.validFrom = validFrom!;
this.userRep.validTo = validTo!;