Skip to main content

API Endpoints

The backend provides the following endpoints for managing categories:

Fetch Categories

  • Endpoint: GET /categories
  • Description: Retrieves the list of all categories.
  • Response:

Create Category

  • Endpoint: POST /categories
  • Description: Creates a new category.
  • Request Body:

Update Category

  • Endpoint: PUT /categories/{id}
  • Description: Updates an existing category.
  • Request Body:

Delete Category

  • Endpoint: DELETE /categories/{id}
  • Description: Deletes a category and reassigns related blog posts.

Auto-Generated Categories from User Tags

  • Users can assign tags to blog posts.
  • If a tag matches an existing category, it is linked automatically.
  • If a tag does not match any existing category, it is grouped under Other.
  • Administrators can later create a proper category and reassign posts.

Frontend Implementation

In the blog creation form, users can select an existing category or enter a new tag. The system processes the input and either assigns it to an existing category or places it under Other.

Conclusion

The category management system ensures efficient content organization and user-friendly navigation. Administrators maintain control over available categories, while users contribute dynamically through tags.