Skip to content

Commit bacc4db

Browse files
author
smileyface12349
committed
Allow validator to silently modify the data
1 parent d873292 commit bacc4db

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

WeddingWebsite/Models/Rsvp/RsvpQuestions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
/// </summary>
66
public record RsvpQuestions(
77
IEnumerable<RsvpQuestion> Questions,
8-
Func<IReadOnlyList<string?>, IEnumerable<string>>? Validator = null
8+
Func<IList<string?>, IEnumerable<string>>? Validator = null
99
)
1010
{
1111
/// <summary>
1212
/// Validates the form on the inputs. Returns an empty list if everything is okay, and a list of error messages
1313
/// otherwise.
1414
/// </summary>
15-
public IEnumerable<string> Validate(IReadOnlyList<string?> data)
15+
public IEnumerable<string> Validate(IList<string?> data)
1616
{
1717
IEnumerable<string> issues = CheckRequiredFields(data);
1818

@@ -26,7 +26,7 @@ public IEnumerable<string> Validate(IReadOnlyList<string?> data)
2626
}
2727
}
2828

29-
private IEnumerable<string> CheckRequiredFields(IReadOnlyList<string?> data)
29+
private IEnumerable<string> CheckRequiredFields(IList<string?> data)
3030
{
3131
IList<string> issues = [];
3232

0 commit comments

Comments
 (0)