Routes Management
Learn how to configure custom route paths for create and update operations using the `routes` property in `CMS_FORM_CONFIG`. This feature allows you to override default API endpoints and customize the
Overview
Use Case 1: Static and Dynamic Routes
Scenario
Configuration
import { CMS_FORM_CONFIG } from '@tradinos/cms-frontend-form';
{
provide: CMS_FORM_CONFIG,
useValue: {
formMode: 'merge',
parseToFormData: false,
removeNullValues: false,
routes: {
create: 'new-create', // Static route for create
update: (id: any) => `new-update/${id.id}`, // Dynamic route for update
},
// ... other configurations
},
}Example from Codebase
Parameters Explained
Parameter
Type
Description
Required
How it Works
Use Case 2: Alternative Route Property Name
Scenario
Configuration
Example from Codebase
Use Case 3: Dynamic Route with Complex Parameters
Scenario
Configuration
Parameters Explained
Parameter
Type
Description
Example
Complete Examples
Example 1: Basic Routes Configuration
Example 2: Nested Routes
Example 3: Conditional Routes
Comparison Table
Property
Type
Use Case
Example
Best Practices
Common Patterns
Pattern 1: Simple Static Routes
Pattern 2: API Versioning
Pattern 3: Nested Resources
Related Documentation
Summary
Last updated