diff --git a/frontend/sweet-red-beans/.prettierrc b/frontend/sweet-red-beans/.prettierrc index d2387cf..9ebb178 100644 --- a/frontend/sweet-red-beans/.prettierrc +++ b/frontend/sweet-red-beans/.prettierrc @@ -1,6 +1,6 @@ { "trailingComma": "es5", - "tabWidth": 4, + "tabWidth": 2, "semi": true, "singleQuote": true, "bracketSameLine": true diff --git a/frontend/sweet-red-beans/src/components/DMPage/DMListThumbnail.js b/frontend/sweet-red-beans/src/components/DMPage/DMListThumbnail.js index fff1b9b..0326a57 100644 --- a/frontend/sweet-red-beans/src/components/DMPage/DMListThumbnail.js +++ b/frontend/sweet-red-beans/src/components/DMPage/DMListThumbnail.js @@ -36,8 +36,7 @@ const DMListThumbnail = ({ dm }) => {
+ }> {
{dm.recent_message}
- {dm.recent_message_date === null + {dm.recent_message_date === '2020-01-01T00:00:00' ? '' : parseDate(dm.recent_message_date)}
diff --git a/frontend/sweet-red-beans/src/components/GeneralBoardPage/GeneralBoard.js b/frontend/sweet-red-beans/src/components/GeneralBoardPage/GeneralBoard.js index a7a6574..79892ac 100644 --- a/frontend/sweet-red-beans/src/components/GeneralBoardPage/GeneralBoard.js +++ b/frontend/sweet-red-beans/src/components/GeneralBoardPage/GeneralBoard.js @@ -62,7 +62,7 @@ const GeneralBoard = ({ searchWords, sort }) => { {infos.slice(offset, offset + limit).map((item, index) => (
{item.title}
@@ -80,7 +80,7 @@ const GeneralBoard = ({ searchWords, sort }) => {
- +
diff --git a/frontend/sweet-red-beans/src/components/GeneralBoardPage/GeneralBoardDetailPage.js b/frontend/sweet-red-beans/src/components/GeneralBoardPage/GeneralBoardDetailPage.js index cead571..2276667 100644 --- a/frontend/sweet-red-beans/src/components/GeneralBoardPage/GeneralBoardDetailPage.js +++ b/frontend/sweet-red-beans/src/components/GeneralBoardPage/GeneralBoardDetailPage.js @@ -175,7 +175,7 @@ const GeneralBoardDetailPage = () => {
- +
diff --git a/frontend/sweet-red-beans/src/components/GeneralBoardPage/GeneralBoardWritePage.js b/frontend/sweet-red-beans/src/components/GeneralBoardPage/GeneralBoardWritePage.js index b89828d..e53f8a0 100644 --- a/frontend/sweet-red-beans/src/components/GeneralBoardPage/GeneralBoardWritePage.js +++ b/frontend/sweet-red-beans/src/components/GeneralBoardPage/GeneralBoardWritePage.js @@ -43,7 +43,7 @@ const GeneralBoardWritePage = () => { .then((response) => { if (response.data.result) { alert('게시글이 성공적으로 작성되었습니다.'); - navigation('/generalBoard'); + navigation('/community/general'); } else { alert('게시글 작성을 실패했습니다.'); } @@ -70,7 +70,7 @@ const GeneralBoardWritePage = () => { .then((response) => { if (response.data.result) { alert('게시글이 성공적으로 작성되었습니다.'); - navigation('/generalBoard'); + navigation('/community/general'); } else { alert('게시글 작성을 실패했습니다.'); } diff --git a/frontend/sweet-red-beans/src/components/InformationShares/InformationShareDetailPage.js b/frontend/sweet-red-beans/src/components/InformationShares/InformationShareDetailPage.js index b89b419..05529a0 100644 --- a/frontend/sweet-red-beans/src/components/InformationShares/InformationShareDetailPage.js +++ b/frontend/sweet-red-beans/src/components/InformationShares/InformationShareDetailPage.js @@ -18,6 +18,8 @@ const InformationShareDetailPage = () => { const [commentContent, setCommentContent] = useState(''); + const [views, setViews] = useState(-1); + //처음 조회 useEffect(() => { document.documentElement.scrollTop = 0; @@ -33,11 +35,13 @@ const InformationShareDetailPage = () => { .then((response) => { setDetailInfo(response.data); setComments(response.data.comment); + setViews(response.data.views); }) .catch((error) => console.log(error)); }, []); useEffect(() => { + console.log('댓글 추가'); setCommentsIsHere(true); }, [comments]); @@ -111,7 +115,7 @@ const InformationShareDetailPage = () => { .then((response) => { if (response.data.result) { console.log('댓글 작성됨'); - navigation(0); + // navigation(0); } else { alert('댓글 작성에 실패했습니다.'); } @@ -122,6 +126,19 @@ const InformationShareDetailPage = () => { } }); } + axios + .get('http://localhost:8080/information-share/detail', { + withCredentials: true, + params: { + post_id: postid, + user_id: '1', + }, + }) + .then((response) => { + setDetailInfo(response.data); + setComments(response.data.comment); + }) + .catch((error) => console.log(error)); }; return ( @@ -145,7 +162,8 @@ const InformationShareDetailPage = () => { : detailInfo.nickname}
{parseDate(detailInfo.written_date)}
-
{detailInfo.views}
+ +
{views}
@@ -185,7 +203,7 @@ const InformationShareDetailPage = () => {
- +
diff --git a/frontend/sweet-red-beans/src/components/InformationShares/InformationShareWritePage.js b/frontend/sweet-red-beans/src/components/InformationShares/InformationShareWritePage.js index 5c0c8df..3747276 100644 --- a/frontend/sweet-red-beans/src/components/InformationShares/InformationShareWritePage.js +++ b/frontend/sweet-red-beans/src/components/InformationShares/InformationShareWritePage.js @@ -173,7 +173,7 @@ const InformationShareWritePage = () => { .then((response) => { if (response.data.result) { alert('게시글이 성공적으로 작성되었습니다.'); - navigation('/informationShare'); + navigation('/community/informationShare'); } else { alert('게시글 작성을 실패했습니다.'); } @@ -204,7 +204,7 @@ const InformationShareWritePage = () => { .then((response) => { if (response.data.result) { alert('게시글이 성공적으로 작성되었습니다.'); - navigation('/informationShare'); + navigation('/community/informationShare'); } else { alert('게시글 작성을 실패했습니다.'); } @@ -257,8 +257,7 @@ const InformationShareWritePage = () => {
+ value={cinemaArea}> {cinemaAreas.map((item) => (