Skip to content

Conversation

@gusfcarvalho
Copy link
Contributor

fix: poam local-defs now are a put operation as opposed to a post

fix: poam local-defs now are a put operation as opposed to a post
Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
Copilot AI review requested due to automatic review settings January 27, 2026 13:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aligns POAM local definitions with the backend behavior by switching the save operation to a PUT and treating missing local definitions (404) as an empty state instead of an error.

Changes:

  • Updated PlanOfActionAndMilestonesLocalDefinitionsView to treat 404s as “no data” (empty/create state) and only show the header “Edit” button when local definitions exist.
  • Updated LocalDefinitionsForm to always issue a PUT to the corrected singular plan-of-action-and-milestones API endpoint.
  • Added unit tests for both the view and the form to cover loading, error/404 handling, empty state, button labels, form submission method, and form data cleanup.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/views/plan-of-actions-and-milestones/PlanOfActionAndMilestonesLocalDefinitionsView.vue Adjusts UI states and error handling so 404 responses are treated as an empty state with a “Create Local Definitions” button, and wires a computed error that suppresses 404s.
src/views/__tests__/PlanOfActionAndMilestonesLocalDefinitionsView.spec.ts Adds tests verifying loading text, 404 behavior (no error, empty state plus create button), and data rendering when components are present.
src/components/poam/LocalDefinitionsForm.vue Fixes the API path to the singular plan-of-action-and-milestones and simplifies submission logic to always use PUT with decamelizeKeys.
src/components/__tests__/LocalDefinitionsForm.spec.ts Adds tests to assert the form always uses PUT (never POST), button labeling for create vs. update, and cleanup of empty components before submit; includes a (slightly weak) test intended to cover the corrected API URL.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gusfcarvalho gusfcarvalho merged commit 9801926 into main Jan 27, 2026
9 checks passed
@gusfcarvalho gusfcarvalho deleted the gc-feat-poam-local-defs branch January 27, 2026 14:14
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