From 85378db21b916549d6dc3a6099443e32b5e2213d Mon Sep 17 00:00:00 2001 From: Sneha Date: Thu, 6 Aug 2026 23:39:56 +0530 Subject: [PATCH] fix(doctor-worklist): guard against undefined success message in care-context popup After a beneficiary returns from the lab and the doctor clicks Update, getHealthIDDetails() concatenated res.data.response directly into the popup text. When that field was falsy, `undefined + '. '` rendered the literal word "undefined" in the success dialog. Fall back to a proper success string, matching the pattern already used by the initial Save flow. Co-Authored-By: Claude Sonnet 5 --- .../app-modules/nurse-doctor/workarea/workarea.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/app-modules/nurse-doctor/workarea/workarea.component.ts b/src/app/app-modules/nurse-doctor/workarea/workarea.component.ts index a0b9dbf..79846c6 100644 --- a/src/app/app-modules/nurse-doctor/workarea/workarea.component.ts +++ b/src/app/app-modules/nurse-doctor/workarea/workarea.component.ts @@ -4469,10 +4469,14 @@ export class WorkareaComponent /* Fetch health ID detaiuls to link the visit */ getHealthIDDetails(successResponseFromAPI: any) { this.getMappedAbdmFacility(); + const successMessage = + successResponseFromAPI ?? + this.current_language_set?.alerts?.info?.datafillSuccessfully ?? + 'Data saved successfully'; this.confirmationService .confirmCareContext( 'info', - successResponseFromAPI + + successMessage + '. ' + (this.current_language_set?.common?.doYouWantToLinkCareContext ?? 'Do you want to link care context?'),