From b78c1d603fc0a2fc51b7e53170398eca8bb85f67 Mon Sep 17 00:00:00 2001 From: SweetySharma Date: Tue, 16 Jan 2024 16:11:32 +0530 Subject: [PATCH] BAH-3472 | Deepti,Sweety,Mohan,Soorya | Refactor bahmniCommonsSearchUrl for patient search. --- ui/app/registration/services/patientService.js | 4 ++-- ui/test/unit/registration/services/patientService.spec.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/app/registration/services/patientService.js b/ui/app/registration/services/patientService.js index f66cadcef8..d0202f7bce 100644 --- a/ui/app/registration/services/patientService.js +++ b/ui/app/registration/services/patientService.js @@ -31,7 +31,7 @@ angular.module('bahmni.registration') }; var searchByIdentifier = function (identifier) { - return $http.get(Bahmni.Common.Constants.bahmniSearchUrl + "/patient", { + return $http.get(Bahmni.Common.Constants.bahmniCommonsSearchUrl + "/patient", { method: "GET", params: { identifier: identifier, @@ -42,7 +42,7 @@ angular.module('bahmni.registration') }; var searchByNameOrIdentifier = function (query, limit) { - return $http.get(Bahmni.Common.Constants.bahmniSearchUrl + "/patient", { + return $http.get(Bahmni.Common.Constants.bahmniCommonsSearchUrl + "/patient", { method: "GET", params: { q: query, diff --git a/ui/test/unit/registration/services/patientService.spec.js b/ui/test/unit/registration/services/patientService.spec.js index a2852eddbc..acda245ed2 100644 --- a/ui/test/unit/registration/services/patientService.spec.js +++ b/ui/test/unit/registration/services/patientService.spec.js @@ -141,7 +141,7 @@ describe('Patient resource', function () { var query = "demo"; patientService.searchByNameOrIdentifier(query, 100); expect(mockHttp.get).toHaveBeenCalled(); - expect(mockHttp.get.calls.mostRecent().args[0]).toBe(Bahmni.Common.Constants.bahmniSearchUrl + "/patient"); + expect(mockHttp.get.calls.mostRecent().args[0]).toBe(Bahmni.Common.Constants.bahmniCommonsSearchUrl + "/patient"); expect(mockHttp.get.calls.mostRecent().args[1].params.q).toBe(query); expect(mockHttp.get.calls.mostRecent().args[1].params.limit).toBe(100); expect(mockHttp.get.calls.mostRecent().args[1].params.s).toBe("byIdOrName");