Feat/post endpoint for skill group parent relation#512
Merged
irumvanselme merged 2 commits intoJul 15, 2026
Conversation
added 2 commits
July 13, 2026 11:39
C5rogers
requested review from
HabtamuTesafaye,
Copilot,
irumvanselme and
rav3n11
July 13, 2026 08:43
| StatusCodes.NOT_FOUND, | ||
| SkillGroupParentsPOSTAPISpecs.Enums.Status404.ErrorCodes.MODEL_NOT_FOUND, | ||
| "Model not found", | ||
| `No model found with id: ${0}` |
There was a problem hiding this comment.
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
deleted the
feat/POST_endpoint_for_SkillGroup_parent_relation
branch
July 15, 2026 05:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In this pull request there is a change on: