Skip to content

Feat/post endpoint for skill group parent relation#512

Merged
irumvanselme merged 2 commits into
mainfrom
feat/POST_endpoint_for_SkillGroup_parent_relation
Jul 15, 2026
Merged

Feat/post endpoint for skill group parent relation#512
irumvanselme merged 2 commits into
mainfrom
feat/POST_endpoint_for_SkillGroup_parent_relation

Conversation

@C5rogers

Copy link
Copy Markdown

In this pull request there is a change on:

  • POST api-specification definetion for SkillGroup Parent relation
  • Handling the POST endpoint for SkillGroup Parent Relation on backend

@C5rogers C5rogers self-assigned this Jul 13, 2026
@C5rogers C5rogers added the enhancement New feature or request label Jul 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

StatusCodes.NOT_FOUND,
SkillGroupParentsPOSTAPISpecs.Enums.Status404.ErrorCodes.MODEL_NOT_FOUND,
"Model not found",
`No model found with id: ${0}`

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The error response for a non-existent model hardcodes the ID as 0 instead of using the actual modelId from the request parameters, providing misleading information.
Severity: LOW

Suggested Fix

Update the template literal in the errorResponse call to use the params.modelId variable instead of the hardcoded 0. The corrected line should be: `No model found with id: ${params.modelId}`.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: backend/src/esco/skillGroup/[id]/parents/POST/index.ts#L118

Potential issue: In the `ModelForSkillGroupValidationErrorCode.MODEL_NOT_FOUND_BY_ID`
error case, the response message is constructed with a hardcoded `0` for the model ID:
`` `No model found with id: ${0}` ``. This results in a misleading error message for
clients and in logs, as it will always report ID `0` regardless of the actual `modelId`
that was not found. While the endpoint correctly returns a 404 status, the diagnostic
detail is incorrect. The analysis notes this is likely a copy-paste error, as a similar
bug exists in the `occupationGroup` endpoint.

Also affects:

  • occupationGroup/[id]/parent/POST/index.ts:117

Did we get this right? 👍 / 👎 to inform future reviews.

@irumvanselme
irumvanselme merged commit 685bdcf into main Jul 15, 2026
13 checks passed
@irumvanselme
irumvanselme deleted the feat/POST_endpoint_for_SkillGroup_parent_relation branch July 15, 2026 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants