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() { create() {
const validFrom = this.range.value.start; const validFrom = this.range.value.start;
const validTo = this.range.value.end; const validTo = this.range.value.end;
if (!validFrom || !validTo) if (!validFrom || !validTo) {
Swal.fire({ Swal.fire({
icon: "error", icon: "error",
title: "Oops...", title: "Oops...",
text: "Bitte geben Sie einen gültigen Datumsbereich ein!", text: "Bitte geben Sie einen gültigen Datumsbereich ein!",
}); });
return;
}
this.userRep.validFrom = validFrom!; this.userRep.validFrom = validFrom!;
this.userRep.validTo = validTo!; this.userRep.validTo = validTo!;