Skip to content

Commit

Permalink
fix:병합 실수로 오류가 생기는 부분 수정 및 공지글 역순 정렬
Browse files Browse the repository at this point in the history
  • Loading branch information
amaran-th committed Mar 21, 2022
1 parent 4d0ccec commit 402acad
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/API/v1/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
2 changes: 2 additions & 0 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down Expand Up @@ -60,6 +61,7 @@ const App = ({ member, darkMode, signOut }) => {
<Route path="/signin/findpassword" element={<FindPassword />} />
<Route path="/signup" element={<SignUp />} />
<Route path="/ranking" element={<Ranking />} />
<Route path="/study" element={<Study />} />
</Routes>
</Suspense>
<Chatting />
Expand Down
2 changes: 1 addition & 1 deletion src/page/Board/Components/Boards.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 10 additions & 2 deletions src/page/Board/Components/FilesUploadForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -187,7 +195,7 @@ const FilesUploadForm = (props) => {
</button>
{files.length !== 0 ? (
<table className="w-full dark:text-mainWhite">
{console.log(files.length)}
{/*console.log(files.length)*/}
<thead className="bg-mainYellow bg-opacity-100 ">
<tr className="">
<th className="rounded-tl-lg">파일명</th>
Expand Down
2 changes: 2 additions & 0 deletions src/page/Board/Components/TextEditer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}, []);

Expand Down

0 comments on commit 402acad

Please sign in to comment.