WEB-918: Fix savings application edit flow#3535
Conversation
|
Note
|
| Cohort / File(s) | Summary |
|---|---|
Savings Account Navigation src/app/savings/savings-account-view/savings-account-view.component.ts |
Modified 'Modify Application' action to navigate via a constructed relative path (../[id]/edit) instead of a simple relative route, deriving the ID from route parameters with a fallback to component data. |
Savings Data Fetching src/app/savings/savings.service.ts |
Refactored getSavingsAccountAndTemplate to conditionally return account data alone when template is falsy, or execute a two-step observable flow (fetch account, then template) and merge results when template is truthy. |
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~20 minutes
Suggested reviewers
- IOhacker
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | ✅ Passed | The title clearly and concisely summarizes the main objective of the PR: fixing the savings application edit flow by addressing the HTTP 400 error users encountered. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
| Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
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.
Comment @coderabbitai help to get the list of available commands and usage tips.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/app/savings/savings-account-view/savings-account-view.component.ts (1)
222-231: Optional: simplify the relative path construction.The
paramMap.get('savingAccountId') || savingsAccountData.idfallback is defensive — the component is bound to the:savingAccountIdroute, so the param is always present and is the very source ofsavingsAccountData.idpopulated by the resolver. Either branch resolves to the same value. You can drop the fallback and usesavingsAccountData.iddirectly for readability.♻️ Proposed simplification
case 'Modify Application': - this.router.navigate( - [ - '../', - this.route.snapshot.paramMap.get('savingAccountId') || this.savingsAccountData.id, - 'edit' - ], - { relativeTo: this.route } - ); + this.router.navigate(['../', this.savingsAccountData.id, 'edit'], { relativeTo: this.route }); break;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/app/savings/savings-account-view/savings-account-view.component.ts` around lines 222 - 231, The navigation in the 'Modify Application' case uses a redundant fallback: replace the expression using route.snapshot.paramMap.get('savingAccountId') || this.savingsAccountData.id with a single, clearer reference to this.savingsAccountData.id in the router.navigate call (inside the case 'Modify Application' block) so the path is constructed directly from the resolved savingsAccountData.id and remove the unnecessary paramMap.get usage.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/app/savings/savings-account-view/savings-account-view.component.ts`:
- Around line 222-231: The navigation in the 'Modify Application' case uses a
redundant fallback: replace the expression using
route.snapshot.paramMap.get('savingAccountId') || this.savingsAccountData.id
with a single, clearer reference to this.savingsAccountData.id in the
router.navigate call (inside the case 'Modify Application' block) so the path is
constructed directly from the resolved savingsAccountData.id and remove the
unnecessary paramMap.get usage.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 1c04a2a0-ca57-4831-af37-ab1d1c80f4bd
📒 Files selected for processing (2)
src/app/savings/savings-account-view/savings-account-view.component.tssrc/app/savings/savings.service.ts
Description
This change fixes the savings account Modify Application flow so users are taken to the edit savings application page instead of getting an HTTP 400 error. The savings edit data is now loaded through supported account and template requests, which avoids the failing savings account template call that was breaking the page.
Dependencies: none beyond the existing savings account APIs.
Related issues and discussion
#WEB-918
After Video:
General.-.Google.Chrome.2026-04-27.20-05-26.mp4
Checklist
Summary by CodeRabbit