I'm creating a CMS using strapi for a client and I would like to give them control of what questions are in a questionnaire. In the questionnaire, each question will be under a section:
-section 1
---question
---question
-section 2
---question
---question
So in strapi I created a collection type with two fields: Section (type enumeration) and Question (type text).
My issue is strapi won't allow me to have spaces in my enumerations so I'm forced to make my section "business_info" when on the site I want to display it as "Business Information". I wrote a simple mapping function (method in vue js) to make it work:
sectionMapping(section) {
switch(section) {
case 'business_info':
return 'Business Information';
case 'target_market':
return 'Target Market';
default:
return 'Section'
}
With this, every time my client wants to add a section to the questionnaire, I would have to do a code update which is not ideal. One solution I came up with was changing section from an enumeration to a text data type, but if my client makes a typo, it would create a whole other section. That's why I like the idea of enumeration.
Any tips?
Thank You