From 4c412b0a1ece206188d0d951751072c5042b6584 Mon Sep 17 00:00:00 2001 From: minuk926 Date: Thu, 31 Mar 2022 20:47:11 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EC=86=8C=EC=8A=A4=20=EC=A0=95?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/biz/board/PublicBoard.jsx | 16 +++++----- src/views/biz/board/PublicBoardForm.jsx | 41 ++++++++++--------------- 2 files changed, 24 insertions(+), 33 deletions(-) diff --git a/src/views/biz/board/PublicBoard.jsx b/src/views/biz/board/PublicBoard.jsx index befc63d..eab8909 100644 --- a/src/views/biz/board/PublicBoard.jsx +++ b/src/views/biz/board/PublicBoard.jsx @@ -93,16 +93,16 @@ const PublicBoard = () => { const submitPublicBoard = (type, payload) => { switch (type) { case 'SAVE': - savePublicBoard(payload); // .then((res) => { - search(); - setOpen(false); - // }); + savePublicBoard(payload).then(() => { + search(); + setOpen(false); + }); // .then((res) => { break; case 'DELETE': - deletePublicBoard(payload); // .then((res) => { - // search(); - setOpen(false); - // }); + deletePublicBoard(payload).then(() => { + search(); + setOpen(false); + }); // .then((res) => { break; default: } diff --git a/src/views/biz/board/PublicBoardForm.jsx b/src/views/biz/board/PublicBoardForm.jsx index 56af0ff..c125600 100644 --- a/src/views/biz/board/PublicBoardForm.jsx +++ b/src/views/biz/board/PublicBoardForm.jsx @@ -21,12 +21,12 @@ const PublicBoardForm = (props) => { const { create, inCode, inDept, inTitle, inHit, inName, inNalja, inFilename, inContents, setOpen, handleModalSave } = props; const alert = useAlert(); const quillRef = useRef(); - const [dept, setDept] = useState(inDept); - const [subject, setSubject] = useState(inTitle); - const [contents, setContents] = useState(inContents); + const [dept, setDept] = useState(inDept || '주정차위반'); + const [subject, setSubject] = useState(inTitle || ''); + const [contents, setContents] = useState(inContents || ''); const [filesInfo, setFilesInfo] = useState(); - const [selectedFile, setSelectedFile] = useState(inFilename); // 파일 - const [fileData, setFileData] = useState(); + const [selectedFile, setSelectedFile] = useState(inFilename || ''); // 파일 + // const [fileData, setFileData] = useState(); const onList = () => { setOpen(false); @@ -131,26 +131,17 @@ const PublicBoardForm = (props) => { setSubject(e.target.value)} fullWidth /> - setDept(e.target.value)} fullWidth> + {/* */} + {/* None */} + {/* */} + 주정차위반 + 장애인위반 + 기타 + {/* */} @@ -168,7 +159,7 @@ const PublicBoardForm = (props) => {