feat(dir): validate ViewUrl segmentNumber & primariness for new FilterLists

This commit is contained in:
Collin M. Barrett 2021-12-06 11:36:14 -06:00
parent fbd5edbbea
commit 7b4174b984

View file

@ -197,7 +197,13 @@ public Validator(IValidator<long?> entityIdValidator, IValidator<Uri?> urlValida
.OverridePropertyName(nameof(Command.TagIds));
RuleForEach(c => c.ViewUrls.Select(u => u.Url))
.SetValidator(urlValidator)
.OverridePropertyName(nameof(Command.ViewUrls));
.OverridePropertyName(nameof(Command.ViewUrls) + "." + nameof(FilterListViewUrl.Url));
RuleForEach(c => c.ViewUrls.Select(u => u.SegmentNumber))
.GreaterThan((short)0)
.OverridePropertyName(nameof(Command.ViewUrls) + "." + nameof(FilterListViewUrl.SegmentNumber));
RuleForEach(c => c.ViewUrls.Select(u => u.Primariness))
.GreaterThan((short)0)
.OverridePropertyName(nameof(Command.ViewUrls) + "." + nameof(FilterListViewUrl.Primariness));
RuleFor(c => c.HomeUrl)
.SetValidator(urlValidator);
RuleFor(c => c.OnionUrl)