Created all validators
This commit is contained in:
@@ -18,7 +18,7 @@ public class CreateReviewDtoValidator : Validator<CreateReviewDto>
|
||||
|
||||
RuleFor(x => x.Rating)
|
||||
.InclusiveBetween(1, 5)
|
||||
.WithMessage("Rating must be between 1 and 5.");
|
||||
.WithMessage(x => $"La note {x.Rating} est invalide. Elle doit être comprise entre 1 et 5.");
|
||||
|
||||
When(x => x.Comment is not null, () =>
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@ public class UpdateReviewDtoValidator : Validator<UpdateReviewDto>
|
||||
|
||||
RuleFor(x => x.Rating)
|
||||
.InclusiveBetween(1, 5)
|
||||
.WithMessage("Rating must be between 1 and 5.");
|
||||
.WithMessage(x => $"La note {x.Rating} est invalide. Elle doit être comprise entre 1 et 5.");
|
||||
|
||||
When(x => x.Comment is not null, () =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user