diff --git a/src/App.js b/src/App.js index 119012de06beffa5c627e01f071a8cb5ae5ad323..ffe8a707bfe31c0a40530581b3042e632a3ed521 100644 --- a/src/App.js +++ b/src/App.js @@ -122,6 +122,36 @@ function App() { "type": 0, // question type = 0 "validation": [] }); + } else if(x.type === "select") { + json.inputs.push({ + "placement": index-1, + "description": "Adicionar esse campo no front", + "question": x.question, + "enabled": x.required, + "type": 3, // select type = 3 + "validation": [], + "sugestions": x.options.map(function(y, index) { return {value: y, placement: index} }) + }); + } else if(x.type === "checkbox") { + json.inputs.push({ + "placement": index-1, + "description": "Adicionar esse campo no front", + "question": x.question, + "enabled": x.required, + "type": 1, // checkbox type = 1 + "validation": [], + "sugestions": x.options.map(function(y, index) { return {value: y, placement: index} }) + }); + } else if(x.type === "radio") { + json.inputs.push({ + "placement": index-1, + "description": "Adicionar esse campo no front", + "question": x.question, + "enabled": x.required, + "type": 2, // radio type = 2 + "validation": [], + "sugestions": x.options.map(function(y, index) { return {value: y, placement: index} }) + }); } });