|
|
|
@ -21,8 +21,8 @@ const ModifyPublicBoardForm = (props) => {
|
|
|
|
|
const alert = useAlert();
|
|
|
|
|
const quillRef = useRef();
|
|
|
|
|
const [dept, setDept] = useState(rowData?.inDept);
|
|
|
|
|
const [subject, setSubject] = useState(rowData?.inTitle);
|
|
|
|
|
const [contents, setContents] = useState(rowData?.inContents);
|
|
|
|
|
const [subject, setSubject] = useState(rowData?.inTitle ?? '');
|
|
|
|
|
const [contents, setContents] = useState(rowData?.inContents ?? '');
|
|
|
|
|
const [filesInfo, setFilesInfo] = useState();
|
|
|
|
|
const [selectedFile, setSelectedFile] = useState(rowData?.inFilename); // 파일
|
|
|
|
|
// const [fileData, setFileData] = useState();
|
|
|
|
@ -43,6 +43,12 @@ const ModifyPublicBoardForm = (props) => {
|
|
|
|
|
// eslint-disable-next-line no-plusplus
|
|
|
|
|
for (let i = 0; i < filesInfo.length; i++) formData.append('files', filesInfo[i]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const replaceContent = contents.replace('<p><br></p>', '').length;
|
|
|
|
|
if (subject.length < 1 || replaceContent < 1) {
|
|
|
|
|
alert.show('제목과 내용은 필수입니다.');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
handleModalSave('SAVE', formData);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|