📂 Category Blocks
Category blocks provide comprehensive functionality for managing hierarchical category structures in Nodeblocks applications. These blocks handle category creation, updates, retrieval, and search operations with support for parent-child relationships.
🎯 Overview
Category blocks are designed to:
- Manage hierarchical categories with parent-child relationships
- Support category lifecycle with enable/disable operations
- Enable category search and filtering capabilities
- Provide CRUD operations for category management
- Support pagination for large category collections
📦 Block Types
🔍 Schemas
JSON Schema definitions for category data validation:
- categorySchema: Base category structure
- createCategorySchema: Category creation validation
- updateCategorySchema: Category modifications
- getCategorySchema: Category retrieval
- deleteCategorySchema: Category deletion
- enableCategorySchema: Category activation
- disableCategorySchema: Category deactivation
- findCategoriesSchema: Category search with filtering and pagination
⚙️ Handlers
Core business logic for category operations:
- createCategory: Category creation with hierarchy support
- getCategoryById: Category data retrieval
- findCategories: Category search and filtering
- updateCategory: Category modifications
- enableCategory: Category activation
- disableCategory: Category deactivation
- deleteCategory: Category deletion with cleanup
View Category Handler Blocks →
🛣️ Routes
HTTP endpoint definitions for category operations:
- createCategoryRoute: POST
/categories
with creation handler - getCategoryRoute: GET
/categories/:id
with retrieval handler - findCategoriesRoute: GET
/categories
with search and pagination - updateCategoryRoute: PUT
/categories/:id
with update handler - enableCategoryRoute: PUT
/categories/:id/enable
with enable handler - disableCategoryRoute: PUT
/categories/:id/disable
with disable handler - deleteCategoryRoute: DELETE
/categories/:id
with deletion handler
🚀 Features
Complete category management features combining schemas, routes, and handlers:
- createCategoryFeature: Category creation with validation and routing
- getCategoryFeatures: Category retrieval with access control
- findCategoriesFeatures: Category search with filtering and pagination
- editCategoryFeatures: Category updates with validation and access control
- enableCategoryStatusFeatures: Category activation functionality
- disableCategoryStatusFeatures: Category deactivation functionality
- editCategoryStatusFeatures: Complete category status management
- deleteCategoryFeatures: Category deletion with proper validation and cleanup
View Category Feature Blocks →
✅ Validators
Validation functions for category operations:
- doesCategoryExist: Validates category existence before operations
View Category Validator Blocks →
🔗 Related Documentation
- Category Schema Blocks - Category data validation and contracts
- Category Handler Blocks - Business logic and category operations
- Category Route Blocks - HTTP endpoint definitions
- Category Feature Blocks - Complete category management features
- Category Validator Blocks - Category validation functions