added UUID to card and form field
This commit is contained in:
@@ -90,6 +90,7 @@ type cardSection struct {
|
||||
|
||||
// card represents a card in the card section
|
||||
type card struct {
|
||||
ID string `bson:"id" json:"id"`
|
||||
Icon string `bson:"icon"`
|
||||
Title string `bson:"title"`
|
||||
Description string `bson:"description"`
|
||||
@@ -105,6 +106,7 @@ type contactSection struct {
|
||||
|
||||
// formField represents a form field in the contact section
|
||||
type formField struct {
|
||||
ID string `bson:"id" json:"id"`
|
||||
Name string `bson:"name"`
|
||||
Label string `bson:"label"`
|
||||
Placeholder string `bson:"placeholder"`
|
||||
|
||||
+11
-2
@@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user