import React, {useEffect, useState} from "react"; import Modal from "react-bootstrap/Modal"; import Form from "react-bootstrap/Form"; import Row from "react-bootstrap/Row"; import Col from "react-bootstrap/Col"; import * as EgovNet from "api/egovFetch"; function QuestionModal({svySeq}){ const [qtTag, setQtTag] = useState([]); const [itemTag, setItemTag] = useState([]); function getSurveyQt(){ EgovNet.requestFetch( '/admin/survey/edit-qt?svySeq='+svySeq, { method: "GET" }, (resp) => { const temp = []; resp.result.qtList.forEach(function (qt, index){ temp.push( selectQt(qt.itemList)}>{qt.qtTitle} ) }) setQtTag(temp); }, function (resp) { console.log("err response : ", resp); } ); } function selectQt(itemList){ const temp = []; itemList.forEach(function (item, index){ temp.push( {item.itemNm} ) }) setItemTag(temp); } function editSurveyQt(e){ } useEffect(() => { getSurveyQt() }, []); return ( <> 질문관리 {qtTag} {itemTag} ); } export default QuestionModal;