From a00015ed7c61d306d4c9aee6a044bfff2f8ae91c Mon Sep 17 00:00:00 2001 From: himeshr Date: Mon, 24 Jul 2023 17:10:12 +0530 Subject: [PATCH] Revert "Revert "#1033 | Use baseservice method instead of convoluted logic"" This reverts commit 717630a0b3891cbcd4747f2a11d9ae4e640bfc34. --- packages/openchs-android/src/service/IndividualService.js | 5 ----- .../src/service/facade/IndividualServiceFacade.js | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/openchs-android/src/service/IndividualService.js b/packages/openchs-android/src/service/IndividualService.js index 9112b6eb1..92eaeb57b 100644 --- a/packages/openchs-android/src/service/IndividualService.js +++ b/packages/openchs-android/src/service/IndividualService.js @@ -673,11 +673,6 @@ 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)); diff --git a/packages/openchs-android/src/service/facade/IndividualServiceFacade.js b/packages/openchs-android/src/service/facade/IndividualServiceFacade.js index e18c7e492..94aff6e9e 100644 --- a/packages/openchs-android/src/service/facade/IndividualServiceFacade.js +++ b/packages/openchs-android/src/service/facade/IndividualServiceFacade.js @@ -10,9 +10,9 @@ class IndividualServiceFacade { .getSubjectsInLocation(addressLevel, subjectTypeName).map(_.identity); } - getSubjectByUUIDAndType(uuid, subjectTypeName) { + getSubjectByUUID(uuid) { return GlobalContext.getInstance().beanRegistry.getService(IndividualService) - .getSubjectByUUIDAndType(uuid, subjectTypeName).map(_.identity); + .findByUUID(uuid); } }