Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance /api/v1/categories/children Endpoint to Return Parent List #29315

Closed
Tracked by #28493
oidacra opened this issue Jul 19, 2024 · 2 comments · Fixed by #29386
Closed
Tracked by #28493

Enhance /api/v1/categories/children Endpoint to Return Parent List #29315

oidacra opened this issue Jul 19, 2024 · 2 comments · Fixed by #29386

Comments

@oidacra
Copy link
Member

oidacra commented Jul 19, 2024

Parent Issue

#28493

User Story

As a developer, I need the /api/v1/categories/children endpoint to return the parentList of categories when showChildrenCount: true is sent. Alternatively, create a new parameter to handle this. This is necessary to provide the path to the parent category for deeper levels (2-N) to help users navigate back to the selected child category.

Acceptance Criteria

  • Modify the /api/v1/categories/children endpoint to include the parentList when parentList: true is sent.
  • Alternatively, add a new parameter to request the parentList.
  • Ensure the parentList provides the complete path to the parent category for deeper levels (2-N).
  • Update the API documentation to reflect the changes.
  • This is only of 1 Level, only for the children of the inode sent.
  • Write unit tests to cover the new functionality.

Proposed Objective

API Enhancement

Proposed Priority

Priority 2 - Important

dotCMS Version

master

Problem

Screenshot 2024-07-19 at 5 16 05 PM

Request don't have parentList
Screenshot 2024-07-19 at 5 18 26 PM

When we sent filter query param, the endpoint retrieve parentList of the category
Screenshot 2024-07-19 at 5 18 49 PM

Assumptions & Initiation Needs

Assuming the current implementation of the /api/v1/categories/children endpoint can be enhanced to include the parentList. Access to the current codebase and API documentation is required.

Quality Assurance Notes & Workarounds

Quality assurance should verify that the parentList is returned correctly when requested and that the API remains stable. Ensure that edge cases, such as categories with no parents, are handled correctly.

@dsilvam
Copy link
Contributor

dsilvam commented Aug 7, 2024

@josemejias11
Copy link
Contributor

Approved: Tested on trunk_a466b5d, Docker, macOS 14.5, FF v126.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants