diff --git a/src/API/v1/post.js b/src/API/v1/post.js index 1871c158..d9795ba6 100644 --- a/src/API/v1/post.js +++ b/src/API/v1/post.js @@ -149,7 +149,7 @@ async function modify({ formData.append('isSecret', isSecret); formData.append('isTemp', isTemp); formData.append('password', password); - formData.append('file', files); + files.forEach((file) => formData.append('file', file)); formData.append('thumbnail', thumbnailFile); const config = { diff --git a/src/App.jsx b/src/App.jsx index bb43a3e5..72098aad 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -26,6 +26,7 @@ const SignUp = lazy(() => import('page/SignUp/SignUp')); const BookAdd = lazy(() => import('./page/Library/BookAdd')); const BookManage = lazy(() => import('./page/Library/BookManage')); const Ranking = lazy(() => import('page/Ranking/Ranking')); +const Study = lazy(() => import('page/Study/Study')); const App = ({ member, darkMode, signOut }) => { useEffect(() => { @@ -60,6 +61,7 @@ const App = ({ member, darkMode, signOut }) => { } /> } /> } /> + } /> diff --git a/src/page/Board/Components/Boards.jsx b/src/page/Board/Components/Boards.jsx index 46e8695a..f3c74373 100644 --- a/src/page/Board/Components/Boards.jsx +++ b/src/page/Board/Components/Boards.jsx @@ -132,7 +132,7 @@ const Boards = ({ categoryId, commentChangeFlag, state, changeMode }) => { category: currentCategoryId, }) .then((res) => { - if (res.success) setNoticeBoardContent(res?.list); + if (res.success) setNoticeBoardContent(res?.list.reverse()); }); postAPI diff --git a/src/page/Board/Components/FilesUploadForm.jsx b/src/page/Board/Components/FilesUploadForm.jsx index c9441afb..7fe7f00a 100644 --- a/src/page/Board/Components/FilesUploadForm.jsx +++ b/src/page/Board/Components/FilesUploadForm.jsx @@ -51,7 +51,15 @@ const FilesUploadForm = (props) => { ); }; - useEffect(() => {}, [files]); + useEffect(() => { + console.log(files); + }, [files]); + useEffect(() => { + if (props.modifyFlag) { + console.log(props.board.files); + //setFiles(props.board.files); + } + }, []); const onDrop = useCallback( (acceptedFiles) => { var temp = [...files]; @@ -187,7 +195,7 @@ const FilesUploadForm = (props) => { {files.length !== 0 ? ( - {console.log(files.length)} + {/*console.log(files.length)*/} diff --git a/src/page/Board/Components/TextEditer.jsx b/src/page/Board/Components/TextEditer.jsx index 4a53c8cd..8fd0f4cf 100644 --- a/src/page/Board/Components/TextEditer.jsx +++ b/src/page/Board/Components/TextEditer.jsx @@ -60,9 +60,11 @@ const TextEditer = (props) => { useEffect(() => { if (modifyFlag) { + setText({ title: board.title, content: board.content }); setAllowComment(!!board.allowComment); setIsNotice(!!board.isNotice); setIsSecret(!!board.isSecret); + setUploadAble(true); } }, []);
파일명