Skip to content

Conversation

@shubhamkumar9199
Copy link
Contributor

@shubhamkumar9199 shubhamkumar9199 commented Jan 3, 2026

This pr fixed the template reports 404 error that occurred when generating client or loan screen reports. The issue had two root causes:

WEB-494

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

  • If you have multiple commits please combine them into one commit by squashing them.

  • Read and understood the contribution guidelines at web-app/.github/CONTRIBUTING.md.

Summary by CodeRabbit

  • Refactor
    • Updated template retrieval methods to use HTTP GET requests instead of POST for improved API design and efficiency.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 3, 2026

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: 'pre_merge_checks'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Walkthrough

Two HTTP service methods have been modified to change their request strategy: retrieveClientReportTemplate in clients.service and getTemplateData in loans.service now use HTTP GET requests to /templates/{templateId} with query parameters instead of POST requests with empty bodies, while maintaining text response handling.

Changes

Cohort / File(s) Summary
Clients Service
src/app/clients/clients.service.ts
retrieveClientReportTemplate method changed from HTTP POST to GET request for /templates/{templateId} endpoint; now passes clientId as query parameter instead of request body.
Loans Service
src/app/loans/loans.service.ts
getTemplateData method changed from HTTP POST to GET request for /templates/{templateId} endpoint; now passes loanId as query parameter instead of request body.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • IOhacker
  • alberto-art3ch

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: converting HTTP POST requests to GET requests for template retrieval to resolve 404 errors in client and loan template reports.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 379a733 and 7d934a4.

📒 Files selected for processing (2)
  • src/app/clients/clients.service.ts
  • src/app/loans/loans.service.ts
🧰 Additional context used
📓 Path-based instructions (1)
src/app/**

⚙️ CodeRabbit configuration file

src/app/**: For Angular code: verify component separation, trackBy on *ngFor,
strict type safety, and clean observable patterns.

Files:

  • src/app/loans/loans.service.ts
  • src/app/clients/clients.service.ts
🔇 Additional comments (2)
src/app/clients/clients.service.ts (1)

352-355: GET method for client report template retrieval is correctly implemented.

The method properly uses GET semantics for retrieving template data with correct parameter handling via HttpParams. Implementation is consistent with getClientReportTemplates() and the RESTful pattern (GET /templates/{templateId} with query parameter). The git commit "WEB-494:fix: resolve template reports 404 error" confirms the backend was updated to support this endpoint. Type safety is properly maintained with string parameters, and usage in the component includes appropriate subscription and security sanitization.

src/app/loans/loans.service.ts (1)

511-514: Use typed parameters for consistency with the rest of the service.

The GET implementation is correct for retrieving template data. However, both templateId and loanId parameters should use string type instead of any, consistent with similar methods throughout the service (e.g., getLoanChargeTemplateResource, getLoanActionTemplate).

🔎 Type safety improvement
-getTemplateData(templateId: any, loanId: any): Observable<any> {
+getTemplateData(templateId: string, loanId: string): Observable<any> {
   const httpParams = new HttpParams().set('loanId', loanId);
   return this.http.get(`/templates/${templateId}`, { params: httpParams, responseType: 'text' });
 }

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@IOhacker IOhacker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@IOhacker IOhacker merged commit 5af11fe into openMF:dev Jan 3, 2026
4 checks passed
@IOhacker
Copy link
Contributor

IOhacker commented Jan 5, 2026

@bharathcgowda this ticket is working and it is available in the dev branch. You can test it in https://sandbox.mifos.community

@bharathcgowda
Copy link
Collaborator

@IOhacker thanks for fixing it.
However I am not able to login to sandbox.mifos.community.

and the issue still exist on the instance https://demo.mifos.community/#/login, is this instance not updated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants