added UUID to card and form field

This commit is contained in:
Mazyar
2025-11-15 10:51:04 +03:30
parent a3472f432d
commit ba06595ab0
2 changed files with 13 additions and 2 deletions
+11 -2
View File
@@ -310,7 +310,12 @@ func (s *cmsService) copyFormToEntity(form *CMSForm, cms *CMS) {
if len(form.Contact.Fields) > 0 {
cms.Contact.Fields = make([]formField, len(form.Contact.Fields))
for i, field := range form.Contact.Fields {
cms.Contact.Fields[i] = formField(field)
cms.Contact.Fields[i] = formField{
Name: field.Name,
Label: field.Label,
Placeholder: field.Placeholder,
Required: field.Required,
}
}
}
@@ -343,7 +348,11 @@ func (s *cmsService) copyCardSectionForm(formSection *cardSectionForm, entitySec
if len(formSection.Cards) > 0 {
entitySection.Cards = make([]card, len(formSection.Cards))
for i, cardForm := range formSection.Cards {
entitySection.Cards[i] = card(cardForm)
entitySection.Cards[i] = card{
Icon: cardForm.Icon,
Title: cardForm.Title,
Description: cardForm.Description,
}
}
}
}