From 72c1b8b567465a80feb5b593f2b5a1e67e1ff644 Mon Sep 17 00:00:00 2001 From: Subin Date: Sat, 17 Jul 2021 15:21:40 +0900 Subject: [PATCH 1/4] =?UTF-8?q?Fix:=20=EA=B0=80=EC=9E=85=EC=8B=9C=20?= =?UTF-8?q?=EA=B4=80=EC=8B=AC=EB=B6=84=EC=95=BC=20=EB=AF=B8=EC=A0=84?= =?UTF-8?q?=EC=86=A1=20=EC=98=A4=EB=A5=98=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/organisms/Join/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/organisms/Join/index.tsx b/src/components/organisms/Join/index.tsx index 91904e51..08abfc3d 100644 --- a/src/components/organisms/Join/index.tsx +++ b/src/components/organisms/Join/index.tsx @@ -58,7 +58,6 @@ function CJoin(): React.ReactElement { }; const modalBtnHandler = async () => { //여기서 api호출!! - setUserData({ ...userData, interest: selectedInterest }); const postData = { email: userData.email, password: userData.password, @@ -81,6 +80,9 @@ function CJoin(): React.ReactElement { const joinBtnHandler = () => { setIsInterestModalOpen(true); }; + useEffect(() => { + setUserData({ ...userData, interest: selectedInterest }); + }, [selectedInterest]); useEffect(() => { if ( From 12474a2f6194c3404ca969895a966d04756b9dfc Mon Sep 17 00:00:00 2001 From: Subin Date: Sat, 17 Jul 2021 15:27:35 +0900 Subject: [PATCH 2/4] =?UTF-8?q?Fix:=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=ED=9B=84?= =?UTF-8?q?=20=ED=95=84=ED=84=B0=EB=A7=81=EC=8B=9C=20isMine=20=EB=94=94?= =?UTF-8?q?=ED=8F=B4=ED=8A=B8=20=EA=B0=92=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/molecules/ChallengeHeader.tsx/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/molecules/ChallengeHeader.tsx/index.tsx b/src/components/molecules/ChallengeHeader.tsx/index.tsx index de77dc9b..1c02f73b 100644 --- a/src/components/molecules/ChallengeHeader.tsx/index.tsx +++ b/src/components/molecules/ChallengeHeader.tsx/index.tsx @@ -55,7 +55,7 @@ function ChallengeHeader({ const [selectedCategory, setSelectedCategory] = useState('전체'); const [keyword, setKeyword] = useState(''); const [booleanMine, setBooleanMine] = useState(false); - const [ismine, setIsmine] = useState(1); + const [ismine, setIsmine] = useState(0); const [userStateNum, setUserState] = useState(userStatusData ? userStatusData.userType : 0); const getChallengeCategoryData = useCallback( From ae84d00d62bf5418004a61297d64d2cb7172376d Mon Sep 17 00:00:00 2001 From: Subin Date: Sat, 17 Jul 2021 15:38:41 +0900 Subject: [PATCH 3/4] =?UTF-8?q?Fix:=20=EC=8A=A4=ED=81=AC=EB=9E=A9=20?= =?UTF-8?q?=EB=A0=8C=EB=8D=94=EB=A7=81=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../molecules/ViewListCard/index.tsx | 13 +++++++++--- src/libs/getChallenge.ts | 21 +++++++------------ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/components/molecules/ViewListCard/index.tsx b/src/components/molecules/ViewListCard/index.tsx index 759bb9a3..c4c3431c 100644 --- a/src/components/molecules/ViewListCard/index.tsx +++ b/src/components/molecules/ViewListCard/index.tsx @@ -98,6 +98,7 @@ function ViewListCard({ const [userStateNickname, setUserStateNickname] = useState(userData ? userData.nickname : 0); const [isMine, setIsMine] = useState(false); const [likeRender, setLikeRender] = useState(isLike); + const [scrapRender, setScrapRender] = useState(isScrap); const getCommentList = useCallback(async () => { if (userStatusData) { @@ -152,14 +153,20 @@ function ViewListCard({ const submitScarp = async () => { if (userStatusData) { const token = userStatusData.token; - await ChallengeScrap(token, id); + const submitSuccess = await ChallengeScrap(token, id); + if (submitSuccess) { + setScrapRender(true); + } } }; const cancelScrap = async () => { if (userStatusData) { const token = userStatusData.token; - await CancelChallengeScrap(token, id); + const cancelSuccess = await CancelChallengeScrap(token, id); + if (cancelSuccess) { + setScrapRender(false); + } } }; @@ -184,7 +191,7 @@ function ViewListCard({

{dayjs(createdAt).format('MM.DD')}

{userStateNum === 0 || userStateNum === 1 || userStateNum === 2 || isMine === false ? ( - isScrap === false ? ( + scrapRender === false ? (