Skip to content

fix(WEB-1038): include template id on update#3724

Merged
IOhacker merged 2 commits into
openMF:devfrom
AnvayKharb:fix/WEB-1038-template-edit-id
Jul 16, 2026
Merged

fix(WEB-1038): include template id on update#3724
IOhacker merged 2 commits into
openMF:devfrom
AnvayKharb:fix/WEB-1038-template-edit-id

Conversation

@AnvayKharb

@AnvayKharb AnvayKharb commented Jul 16, 2026

Copy link
Copy Markdown
Member

Summary

Includes the existing template ID in the update request payload when editing a template.

The current template update API requires the template ID in both the request path and request body. The Web App previously supplied it only in the path, causing template updates to fail with an id.not-null validation error.

The template creation flow remains unchanged.

Related issues and discussion

#WEB-1038

Summary by CodeRabbit

  • Bug Fixes

    • Fixed template editing so the existing template ID is preserved when saving changes.
  • Tests

    • Added unit test coverage for the template create/edit flows, verifying the correct save action is called and that submitted data matches expectations for both modes.

@AnvayKharb
AnvayKharb requested a review from a team July 16, 2026 10:49
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

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: "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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 25e7f139-9f25-4732-8f0b-48b7c251781e

📥 Commits

Reviewing files that changed from the base of the PR and between 4062854 and c809dc8.

📒 Files selected for processing (2)
  • src/app/templates/create-edit-template/create-edit-template.component.spec.ts
  • src/app/templates/create-edit-template/create-edit-template.component.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/app/templates/create-edit-template/create-edit-template.component.spec.ts
  • src/app/templates/create-edit-template/create-edit-template.component.ts

Walkthrough

The edit submission flow now includes the existing template ID before updating. New Jest tests cover the create and edit payloads and verify that each mode invokes only its corresponding service method.

Changes

Template submission

Layer / File(s) Summary
Create and edit submit payloads
src/app/templates/create-edit-template/create-edit-template.component.ts, src/app/templates/create-edit-template/create-edit-template.component.spec.ts
Edit mode assigns the existing template ID before calling updateTemplate; create mode omits the ID, with tests covering payload fields and mutually exclusive service calls.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding the template ID to update requests.
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.
✨ 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.

❤️ Share

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

@AnvayKharb
AnvayKharb force-pushed the fix/WEB-1038-template-edit-id branch from 4062854 to 4d7a27b Compare July 16, 2026 11:00
@AnvayKharb
AnvayKharb force-pushed the fix/WEB-1038-template-edit-id branch from 4d7a27b to 5d0ef37 Compare July 16, 2026 11:05

@IOhacker IOhacker left a comment

Copy link
Copy Markdown
Contributor

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 e3cb18e into openMF:dev Jul 16, 2026
5 of 6 checks passed
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.

2 participants