From 7b4174b98428dc142cc045c69207bf4f7b8a1c41 Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Mon, 6 Dec 2021 11:36:14 -0600 Subject: [PATCH] =?UTF-8?q?feat(dir):=20=E2=9C=A8=20validate=20ViewUrl=20s?= =?UTF-8?q?egmentNumber=20&=20primariness=20for=20new=20FilterLists?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Commands/CreateList.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/services/Directory/FilterLists.Directory.Application/Commands/CreateList.cs b/services/Directory/FilterLists.Directory.Application/Commands/CreateList.cs index 38d453195..fc479ef87 100644 --- a/services/Directory/FilterLists.Directory.Application/Commands/CreateList.cs +++ b/services/Directory/FilterLists.Directory.Application/Commands/CreateList.cs @@ -197,7 +197,13 @@ public Validator(IValidator entityIdValidator, IValidator 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)