Skip to content

Commit

Permalink
fix data annotations validation in 3 forms
Browse files Browse the repository at this point in the history
  • Loading branch information
NielsPilgaard committed Aug 26, 2024
1 parent c0ced6c commit efbda25
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/shared/Jordnaer.Shared/Email/ContactForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public class ContactForm
[EmailAddress(ErrorMessage = "Email skal være gyldig.")]
public string Email { get; set; } = null!;

[Required(ErrorMessage = "Besked må ikke være blank.")]
[Required(ErrorMessage = "Beskeden må ikke være blank.")]
[MinLength(1, ErrorMessage = "Beskeden må ikke være blank")]
public string Message { get; set; } = null!;
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<MudDivider Class="mb-5 mt-1"/>

<EditForm OnValidSubmit="@OnValidSubmit" Model="Filter">
<DataAnnotationsValidator />

<MudGrid Justify="Justify.SpaceAround" Spacing="6">

Expand Down
1 change: 1 addition & 0 deletions src/web/Jordnaer/Features/UserSearch/UserSearchForm.razor
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<MudDivider Class="mb-5 mt-1" />

<EditForm OnValidSubmit="@OnValidSubmit" Model="Filter">
<DataAnnotationsValidator />

<MudGrid Justify="Justify.SpaceAround" Spacing="6">

Expand Down

0 comments on commit efbda25

Please sign in to comment.