From 26091c68b0e8090eff25dab01a8949c7edda2f36 Mon Sep 17 00:00:00 2001 From: keshav Date: Mon, 3 Aug 2026 10:51:07 +0530 Subject: [PATCH] fix(accounting): prioritize specific Fineract error messages when AML marking fails --- .../search-journal-entry/search-journal-entry.component.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/accounting/search-journal-entry/search-journal-entry.component.ts b/src/app/accounting/search-journal-entry/search-journal-entry.component.ts index 78839ffff..60cb80889 100644 --- a/src/app/accounting/search-journal-entry/search-journal-entry.component.ts +++ b/src/app/accounting/search-journal-entry/search-journal-entry.component.ts @@ -327,8 +327,11 @@ export class SearchJournalEntryComponent implements OnInit, OnDestroy, AfterView }, error: (err: any) => { this.marking.delete(entry.id); + // Fineract wraps the real reason in errors[0]; the outer defaultUserMessage + // is the generic "Errors contain reason for domain rule violation", which + // tells the reviewer nothing. this.markError = - err?.error?.defaultUserMessage || err?.error?.errors?.[0]?.defaultUserMessage || 'Could not mark this entry.'; + err?.error?.errors?.[0]?.defaultUserMessage || err?.error?.defaultUserMessage || 'Could not mark this entry.'; } }); }