Skip to content

Commit

Permalink
Fix for alternative location
Browse files Browse the repository at this point in the history
  • Loading branch information
samgibsonmoj committed Aug 19, 2024
1 parent 67f7c1a commit a30691e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ public Validator()
When(x => x.EnrolFromAlternativeLocation, () => {
RuleFor(x => x.AlternativeLocation)
.NotNull()
.WithMessage("You must provide an alternative location")
.WithMessage("You must provide an alternative location");

RuleFor(x => x.AlternativeLocation)
.Must((x, alternativeLocation) => x.CurrentLocation.Id != alternativeLocation!.Id)
.When(x => x.AlternativeLocation is not null)
.WithMessage("You must provide a different alternative location to the current location");
Expand Down

0 comments on commit a30691e

Please sign in to comment.