SHA256
GuestLog - GuestDocument fixes & improvements:
- Use GuestDocument Details page to see details. - Added GuestDocument stays in details page. Other minor changes: - Updated validators to use ValueValidator base class. - Changed Snackbar settings to show them better. - Added Empty Debug page to test things. This page wont be updated in git, all test must be local-only.
This commit is contained in:
@@ -8,7 +8,7 @@ namespace Somnia.GuestLog.Validators;
|
||||
/// <summary>
|
||||
/// Validator for GuestDocumentDTO which contains multiple rules and can be shared with the back end API
|
||||
/// </summary>
|
||||
public class GuestDocumentDTOValidator : AbstractValidator<GuestDocumentDTO>
|
||||
public class GuestDocumentDTOValidator : ValueValidator<GuestDocumentDTO>
|
||||
{
|
||||
public GuestDocumentDTOValidator(IDataListService dataListService)
|
||||
{
|
||||
@@ -82,11 +82,4 @@ public class GuestDocumentDTOValidator : AbstractValidator<GuestDocumentDTO>
|
||||
// RuleForEach(x => x.OrderDetails)
|
||||
// .SetValidator(new OrderDetailsModelFluentValidator());
|
||||
}
|
||||
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<GuestDocumentDTO>.CreateWithOptions((GuestDocumentDTO)model, x =>
|
||||
x.IncludeProperties(propertyName)));
|
||||
return result.IsValid ? [] : result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user