Skip to content

Commit

Permalink
Revert "Revert "#1033 | Introduce new method IndividualService.getSub…
Browse files Browse the repository at this point in the history
…jectByUUIDAndType""

This reverts commit 5d8fa93.
  • Loading branch information
himeshr committed Jul 24, 2023
1 parent 1b55df4 commit 2a2d134
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/openchs-android/src/service/IndividualService.js
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,11 @@ class IndividualService extends BaseService {
.sorted('name');
}

getSubjectByUUIDAndType(uuid, subjectTypeName) {
return this.getAllNonVoided()
.find('uuid = $0 and subjectType.name = $1', uuid, subjectTypeName);
}

findAllWithMobileNumber(mobileNumber) {
return this.getAllNonVoided()
.filter(ind => _.toString(ind.getMobileNumber()).slice(-10) === _.toString(mobileNumber).slice(-10));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ class IndividualServiceFacade {
return GlobalContext.getInstance().beanRegistry.getService(IndividualService)
.getSubjectsInLocation(addressLevel, subjectTypeName).map(_.identity);
}

getSubjectByUUIDAndType(uuid, subjectTypeName) {
return GlobalContext.getInstance().beanRegistry.getService(IndividualService)
.getSubjectByUUIDAndType(uuid, subjectTypeName).map(_.identity);
}
}

const individualServiceFacade = new IndividualServiceFacade();
Expand Down

0 comments on commit 2a2d134

Please sign in to comment.