Fix validation of ChangeColorsRequest

This commit is contained in:
Jonathan Bourdon
2024-08-06 02:26:10 -04:00
parent c1ec282398
commit 7cd7ae3080

View File

@@ -19,22 +19,22 @@ public sealed class ChangeColorsRequestValidator
{ {
RuleFor(x => x.BannerTop) RuleFor(x => x.BannerTop)
.MinimumLength(4).WithMessage("The minimum value should be in the format #444") .MinimumLength(4).WithMessage("The minimum value should be in the format #444")
.MinimumLength(9).WithMessage("The maximum value should be in the format #11223344") .MaximumLength(9).WithMessage("The maximum value should be in the format #11223344")
.Must(x => x.StartsWith('#')).WithMessage("The format should be a valid html color and start with #"); .Must(x => x.StartsWith('#')).WithMessage("The format should be a valid html color and start with #");
RuleFor(x => x.BannerBottom) RuleFor(x => x.BannerBottom)
.MinimumLength(4).WithMessage("The minimum value should be in the format #444") .MinimumLength(4).WithMessage("The minimum value should be in the format #444")
.MinimumLength(9).WithMessage("The maximum value should be in the format #11223344") .MaximumLength(9).WithMessage("The maximum value should be in the format #11223344")
.Must(x => x.StartsWith('#')).WithMessage("The format should be a valid html color and start with #"); .Must(x => x.StartsWith('#')).WithMessage("The format should be a valid html color and start with #");
RuleFor(x => x.Accent) RuleFor(x => x.Accent)
.MinimumLength(4).WithMessage("The minimum value should be in the format #444") .MinimumLength(4).WithMessage("The minimum value should be in the format #444")
.MinimumLength(9).WithMessage("The maximum value should be in the format #11223344") .MaximumLength(9).WithMessage("The maximum value should be in the format #11223344")
.Must(x => x.StartsWith('#')).WithMessage("The format should be a valid html color and start with #"); .Must(x => x.StartsWith('#')).WithMessage("The format should be a valid html color and start with #");
RuleFor(x => x.Menu) RuleFor(x => x.Menu)
.MinimumLength(4).WithMessage("The minimum value should be in the format #444") .MinimumLength(4).WithMessage("The minimum value should be in the format #444")
.MinimumLength(9).WithMessage("The maximum value should be in the format #11223344") .MaximumLength(9).WithMessage("The maximum value should be in the format #11223344")
.Must(x => x.StartsWith('#')).WithMessage("The format should be a valid html color and start with #"); .Must(x => x.StartsWith('#')).WithMessage("The format should be a valid html color and start with #");
} }
} }