Update CMS Entity and Forms to Include New Fields
- Added new fields to the CMS entity: CompanyName, Country, and Language, enhancing the data structure for better content management. - Updated the CMSForm to include validation and examples for the new fields, ensuring proper input handling. - Modified the copyFormToEntity method in the CMS service to map the new fields from the form to the entity, maintaining data integrity. - Enhanced Swagger documentation to reflect the changes in the CMS API, providing clear examples for the new fields.
This commit is contained in:
@@ -236,6 +236,15 @@ func (s *cmsService) Search(ctx context.Context, form *SearchCMSForm, pagination
|
||||
|
||||
// copyFormToEntity copies data from form to entity
|
||||
func (s *cmsService) copyFormToEntity(form *CMSForm, cms *CMS) {
|
||||
if form.Language != "" {
|
||||
cms.Language = form.Language
|
||||
}
|
||||
if form.CompanyName != "" {
|
||||
cms.CompanyName = form.CompanyName
|
||||
}
|
||||
if form.Country != "" {
|
||||
cms.Country = form.Country
|
||||
}
|
||||
// Hero section
|
||||
if form.Hero.Title != "" {
|
||||
cms.Hero.Title = form.Hero.Title
|
||||
|
||||
Reference in New Issue
Block a user