Skip to content

Commit

Permalink
#1430 | Validate visit schedule rules using earliestDate instead of e…
Browse files Browse the repository at this point in the history
…arliestVisitDateTime field
  • Loading branch information
1t5j0y committed Jun 24, 2024
1 parent 8893328 commit 499c74c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/openchs-android/src/service/RuleEvaluationService.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,8 @@ class RuleEvaluationService extends BaseService {
}

checkIfScheduledVisitsAreValid(nextVisits) {
if (nextVisits.map(visit => _.isNil(visit.earliestVisitDateTime)).length > 0) {
throw new Error("Visit(s) scheduled without earliestVisitDateTime");
if (_.some(nextVisits, visit => _.isNil(visit.earliestDate))) {
throw new Error("Visit(s) scheduled without earliestDate");
}
}

Expand Down

0 comments on commit 499c74c

Please sign in to comment.