From 2122f42e54478b49ffbb2e95fd6b5cb1e26feb13 Mon Sep 17 00:00:00 2001 From: ImxYJL Date: Tue, 23 Jul 2024 14:19:08 +0900 Subject: [PATCH 1/6] =?UTF-8?q?chore:=20gitignore=EC=97=90=20yarn-error.lo?= =?UTF-8?q?g=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/.gitignore b/frontend/.gitignore index 3c14f073d..6e89b4d62 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -1,4 +1,5 @@ node_modules dist +yarn-error.log .env \ No newline at end of file From a2a604219b1f399207ddb1e70b67dcb6b8e1c996 Mon Sep 17 00:00:00 2001 From: ImxYJL Date: Tue, 23 Jul 2024 14:20:46 +0900 Subject: [PATCH 2/6] =?UTF-8?q?ci:=20env=20=ED=8C=8C=EC=9D=BC=20=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=EC=9D=84=20=EC=9C=84=ED=95=9C=20dotenv-webpack=20?= =?UTF-8?q?=EC=84=A4=EC=B9=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/package.json | 1 + frontend/webpack.config.js | 4 +++ frontend/yarn.lock | 50 +++++++++++++++++--------------------- 3 files changed, 27 insertions(+), 28 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 1e2b653a1..f62155703 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -13,6 +13,7 @@ "@emotion/styled": "^11.11.5", "@tanstack/react-query": "^5.51.1", "@tanstack/react-query-devtools": "^5.51.1", + "dotenv-webpack": "^8.1.0", "react": "^18.3.1", "react-dom": "^18.3.1", "react-router": "^6.24.1", diff --git a/frontend/webpack.config.js b/frontend/webpack.config.js index 207d9492b..e6f11d1d3 100644 --- a/frontend/webpack.config.js +++ b/frontend/webpack.config.js @@ -1,6 +1,7 @@ const { CleanWebpackPlugin } = require('clean-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const path = require('path'); +const Dotenv = require('dotenv-webpack'); module.exports = (env, argv) => { const isProduction = argv.mode === 'production'; @@ -49,6 +50,9 @@ module.exports = (env, argv) => { hash: true, }), new CleanWebpackPlugin(), + new Dotenv({ + path: './.env', + }), ], devtool: isProduction ? 'hidden-source-map' : 'eval', devServer: { diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 19dee1f2c..d942f26bb 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -2892,6 +2892,25 @@ dot-case@^3.0.4: no-case "^3.0.4" tslib "^2.0.3" +dotenv-defaults@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/dotenv-defaults/-/dotenv-defaults-2.0.2.tgz#6b3ec2e4319aafb70940abda72d3856770ee77ac" + integrity sha512-iOIzovWfsUHU91L5i8bJce3NYK5JXeAwH50Jh6+ARUdLiiGlYWfGw6UkzsYqaXZH/hjE/eCd/PlfM/qqyK0AMg== + dependencies: + dotenv "^8.2.0" + +dotenv-webpack@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/dotenv-webpack/-/dotenv-webpack-8.1.0.tgz#4d66abc4a30395b46a030ebcd125320232b54873" + integrity sha512-owK1JcsPkIobeqjVrk6h7jPED/W6ZpdFsMPR+5ursB7/SdgDyO+VzAU+szK8C8u3qUhtENyYnj8eyXMR5kkGag== + dependencies: + dotenv-defaults "^2.0.2" + +dotenv@^8.2.0: + version "8.6.0" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.6.0.tgz#061af664d19f7f4d8fc6e4ff9b584ce237adcb8b" + integrity sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g== + eastasianwidth@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" @@ -5710,16 +5729,7 @@ strict-event-emitter@^0.5.1: resolved "https://registry.yarnpkg.com/strict-event-emitter/-/strict-event-emitter-0.5.1.tgz#1602ece81c51574ca39c6815e09f1a3e8550bd93" integrity sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ== -"string-width-cjs@npm:string-width@^4.2.0": - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -5797,14 +5807,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -6440,7 +6443,7 @@ word-wrap@^1.2.5: resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34" integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -6458,15 +6461,6 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" From 1ae160f9ea03bc1dca4b13b4792bfe665dfe4bf5 Mon Sep 17 00:00:00 2001 From: ImxYJL Date: Tue, 23 Jul 2024 14:24:30 +0900 Subject: [PATCH 3/6] =?UTF-8?q?refactor:=20=EC=97=94=EB=93=9C=ED=8F=AC?= =?UTF-8?q?=EC=9D=B8=ED=8A=B8=EC=97=90=20env=20=ED=8C=8C=EC=9D=BC=EC=9D=84?= =?UTF-8?q?=20=ED=86=B5=ED=95=9C=20API=5FBASE=5FURL=20=EA=B2=BD=EB=A1=9C?= =?UTF-8?q?=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/apis/endpoints.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/frontend/src/apis/endpoints.ts b/frontend/src/apis/endpoints.ts index 13e4a4488..71b5ae7c4 100644 --- a/frontend/src/apis/endpoints.ts +++ b/frontend/src/apis/endpoints.ts @@ -1,10 +1,8 @@ -const API_BASE_URL = 'http://localhost:8080'; - const endPoint = { - postingReview: `${API_BASE_URL}/reviews`, - gettingDetailedReview: (reviewId: number) => `${API_BASE_URL}/reviews/${reviewId}`, + postingReview: `${process.env.API_BASE_URL}/reviews`, + gettingDetailedReview: (reviewId: number) => `${process.env.API_BASE_URL}/reviews/${reviewId}`, gettingInfoToWriteReview: (reviewerGroupId: number) => `/reviewer-groups/${reviewerGroupId}`, - gettingKeyword: `${API_BASE_URL}/keywords`, + gettingKeyword: `${process.env.API_BASE_URL}/keywords`, }; export default endPoint; From fc0d55bedb86f762dbed0021db55850c312cadf8 Mon Sep 17 00:00:00 2001 From: ImxYJL Date: Tue, 23 Jul 2024 14:29:38 +0900 Subject: [PATCH 4/6] =?UTF-8?q?fix:=20=EB=A6=AC=EB=B7=B0=20=EC=83=81?= =?UTF-8?q?=EC=84=B8=EB=B3=B4=EA=B8=B0=20=EB=8D=B0=EC=9D=B4=ED=84=B0?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=EB=B0=B1=EC=97=94=EB=93=9C=20=EC=9D=91?= =?UTF-8?q?=EB=8B=B5=EA=B3=BC=20=EC=86=8D=EC=84=B1=20=EC=9D=B4=EB=A6=84?= =?UTF-8?q?=EC=9D=B4=20=EB=8B=AC=EB=9E=90=EB=8D=98=20=EB=B6=80=EB=B6=84=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/pages/DetailedReviewPage/index.tsx | 22 ++++++++++++++----- frontend/src/types/review.ts | 2 +- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/frontend/src/pages/DetailedReviewPage/index.tsx b/frontend/src/pages/DetailedReviewPage/index.tsx index e0c64fbf0..57e1d5a7f 100644 --- a/frontend/src/pages/DetailedReviewPage/index.tsx +++ b/frontend/src/pages/DetailedReviewPage/index.tsx @@ -15,7 +15,7 @@ const MOCK_DATA: DetailReviewData = { name: '올리', }, createdAt: new Date('2024-07-16'), - reviewGroup: { + reviewerGroup: { groupId: 123456, name: 'review-me', }, @@ -38,8 +38,9 @@ const DetailedReviewPage = ({}) => { const fetch = async () => { try { setIsLoading(true); - getDetailedReviewApi({ reviewId: 123456 }).then((result) => { + getDetailedReviewApi({ reviewId: 4 }).then((result) => { setDetailReview(result); + console.log(result); setErrorMessage(''); }); } catch (error) { @@ -52,13 +53,24 @@ const DetailedReviewPage = ({}) => { }; useEffect(() => { - //fetch(); + fetch(); }, []); + if (isLoading) return
Loading...
; + + if (errorMessage) return
Error: {errorMessage}
; + return ( <> - - {MOCK_DATA.contents.map((item, index) => ( + + {detailReview.contents.map((item, index) => ( ))} diff --git a/frontend/src/types/review.ts b/frontend/src/types/review.ts index f891da13f..a91508349 100644 --- a/frontend/src/types/review.ts +++ b/frontend/src/types/review.ts @@ -10,7 +10,7 @@ export interface DetailReviewData { memberId: number; name: string; }; - reviewGroup: { + reviewerGroup: { groupId: number; name: string; }; From 46238dbfbf3853d94831585e91e272791a8f91ac Mon Sep 17 00:00:00 2001 From: ImxYJL Date: Tue, 23 Jul 2024 14:31:23 +0900 Subject: [PATCH 5/6] =?UTF-8?q?refactor:=20=EB=B0=B1=EC=97=94=EB=93=9C=20?= =?UTF-8?q?=EC=9D=91=EB=8B=B5=20=EB=B0=8F=20=EB=A6=AC=ED=8C=A9=ED=86=A0?= =?UTF-8?q?=EB=A7=81=EB=90=9C=20=EB=A6=AC=EB=B7=B0=20=EC=93=B0=EA=B8=B0=20?= =?UTF-8?q?=ED=98=95=EC=8B=9D=EC=97=90=20=EB=A7=9E=EA=B2=8C=20=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EC=93=B0=EA=B8=B0=20=EB=AA=A8=ED=82=B9=20=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=84=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/ReviewWriting/index.tsx | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/frontend/src/pages/ReviewWriting/index.tsx b/frontend/src/pages/ReviewWriting/index.tsx index dbd9a418c..8b42647ca 100644 --- a/frontend/src/pages/ReviewWriting/index.tsx +++ b/frontend/src/pages/ReviewWriting/index.tsx @@ -14,9 +14,10 @@ const ReviewWritingPage = () => { const handleSubmitReview = async (event: React.FormEvent) => { event.preventDefault(); + // NOTE: 모킹 데이터 const reviewData: ReviewData = { - reviewerId: 1, - reviewerGroupId: 1, + reviewerId: 8, + reviewerGroupId: 5, contents: [ { order: 1, @@ -26,20 +27,21 @@ const ReviewWritingPage = () => { { order: 2, question: '2. 동료의 소프트 스킬의 성장을 위해 피드백을 남겨 주세요.', + + answer: (event.target as any).question2.value, + }, + { + order: 3, + question: '3. 마지막 질문', + answer: (event.target as any).question2.value, }, ], - selectedKeywordIds: [ - (event.target as any).keyword1.checked ? 1 : null, - (event.target as any).keyword2.checked ? 2 : null, - (event.target as any).keyword3.checked ? 3 : null, - ].filter(Boolean) as number[], + selectedKeywordIds: [1, 2], }; - //console.log(reviewData); try { await postReviewApi({ reviewData }); - console.log('Review submitted successfully'); } catch (error) { console.error('Failed to submit review:', error); } From b76b101b1ca092b3ddd9a31d01512f03e10be1f1 Mon Sep 17 00:00:00 2001 From: ImxYJL Date: Tue, 23 Jul 2024 14:33:58 +0900 Subject: [PATCH 6/6] =?UTF-8?q?chore:=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20console.log=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/DetailedReviewPage/index.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/src/pages/DetailedReviewPage/index.tsx b/frontend/src/pages/DetailedReviewPage/index.tsx index 57e1d5a7f..45860b638 100644 --- a/frontend/src/pages/DetailedReviewPage/index.tsx +++ b/frontend/src/pages/DetailedReviewPage/index.tsx @@ -40,7 +40,6 @@ const DetailedReviewPage = ({}) => { setIsLoading(true); getDetailedReviewApi({ reviewId: 4 }).then((result) => { setDetailReview(result); - console.log(result); setErrorMessage(''); }); } catch (error) {