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:
Nima Nakhostin
2025-11-09 09:24:23 +03:30
parent 7fc6568d02
commit 9fe86d4f8e
6 changed files with 64 additions and 16 deletions
+12
View File
@@ -7744,9 +7744,17 @@ const docTemplate = `{
"chart": {
"$ref": "#/definitions/cms.chartSectionForm"
},
"company_name": {
"type": "string",
"example": "Opplens"
},
"contact": {
"$ref": "#/definitions/cms.contactSectionForm"
},
"country": {
"type": "string",
"example": "SWE"
},
"features": {
"$ref": "#/definitions/cms.cardSectionForm"
},
@@ -7759,6 +7767,10 @@ const docTemplate = `{
"key": {
"type": "string",
"example": "SW-001"
},
"language": {
"type": "string",
"example": "en"
}
}
},
+12
View File
@@ -7736,9 +7736,17 @@
"chart": {
"$ref": "#/definitions/cms.chartSectionForm"
},
"company_name": {
"type": "string",
"example": "Opplens"
},
"contact": {
"$ref": "#/definitions/cms.contactSectionForm"
},
"country": {
"type": "string",
"example": "SWE"
},
"features": {
"$ref": "#/definitions/cms.cardSectionForm"
},
@@ -7751,6 +7759,10 @@
"key": {
"type": "string",
"example": "SW-001"
},
"language": {
"type": "string",
"example": "en"
}
}
},
+9
View File
@@ -30,8 +30,14 @@ definitions:
$ref: '#/definitions/cms.cardSectionForm'
chart:
$ref: '#/definitions/cms.chartSectionForm'
company_name:
example: Opplens
type: string
contact:
$ref: '#/definitions/cms.contactSectionForm'
country:
example: SWE
type: string
features:
$ref: '#/definitions/cms.cardSectionForm'
footer:
@@ -41,6 +47,9 @@ definitions:
key:
example: SW-001
type: string
language:
example: en
type: string
type: object
cms.CMSListResponse:
properties: