-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
๐จFix : profile/follow button ์๋ฌ์์ #80
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ ๋ ํ๋ก์,ํ๋ก์ฐ ์์๊ฐ ์ต์ํ๋ค์!ใ ใ
@@ -8,7 +8,7 @@ const postFollowUser = async (userId: string, token: string) => { | |||
{ userId }, | |||
{ | |||
headers: { | |||
Authorization: token |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ ๋ 'bearer ' ๋ถ๋ถ์ api๋จ์ด ์๋ UI๋ ์ด์ด์์ ๋ถ์ฌ์ ๋ณด๋ด์ฃผ๋๋ฐ ํต์ผํด์ผ๊ฒ ๋ค์?! ์ด๋์ชฝ์ด ๋ ์ข์๊น์?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
api๋จ์ด ๋ ์ข์ ๊ฒ ๊ฐ์์! ์๋๋ฉด ์ธ์ ์ ์ ์ฅํ ๋ bearer์ ๋ถ์ด๊ณ ์ ์ฅํ๋๊ฑด ์ด๋จ๊น์?
const [userSessionData] = useSessionStorage<Pick<User, '_id' | 'token'>>( | ||
'userData', | ||
{ | ||
_id: '', | ||
token: '' | ||
} | ||
); | ||
const { token, _id } = userSessionData; | ||
const { token } = userSessionData; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const [userSessionData] = useSessionStorage<Pick<User, 'token'>>(
'userData',
{
token: ''
}
);
์ธ์ ์์ ํ ํฐ๋ง ๊ฐ์ ธ์จ๋ค๋ฉด ์ด๋ ๊ฒ ์์ฑํด์ฃผ์๋ฉด ๋ฉ๋๋ค!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๊ตฟ๊ตฟ! ๋์ฐ๋ ๊ณ ์ํ์ จ์ต๋๋ค~
followDataId: string; | ||
followingDataId: string; // ์ญ์ ์ฉ - following data id | ||
followingUserId: string; // ํ๋ก์ฐ์ฉ - ํ๋ก์ฐํ userId | ||
following?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default ๊ฐ์ ๋ถ์ฌํ๊ณ ์์ด์ ์ต์ ๋๋ก ์ฒ๋ฆฌํ์ง ์์ผ์ ๋ ๊ด์ฐฎ์ง ์์๊น์?
followingDataId: string; // ์ญ์ ์ฉ - following data id | ||
followingUserId: string; // ํ๋ก์ฐ์ฉ - ํ๋ก์ฐํ userId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
postFollowUser -> followUser
deleteFollowUser -> unfollowUser
followingUserId -> ํ์์ ์ง
followingDataId -> unfollowingUserId
๊ฐ์ธ์ ์ผ๋ก๋ ์ด๊ฒ ๋ ์ง๊ด์ ์ผ๋ก ๋ณด์ฌ์ ์ ์๋๋ ธ๋๋ฐ ์ด๋ป๊ฒ ์๊ฐํ์๋์ฉ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋คํธ์ํฌ ์์ฒญ ํจ์๋ ์์ ๋ฉ์๋๋ฅผ ๋ถ์ด๋ ์ปจ๋ฒค์ ์ด ์์ด์ deleteFollowUser, postFollowUser๋ ์ ์งํด์ผ ํ ๊ฒ ๊ฐ์์! ใ
followingDataId๋ userId๊ฐ ์๋ ์ง์ง following ๋ฐ์ดํฐ ์์ด๋๋๋๋ค.. ใ ใ
โฆIRVANA_Gidong into feat/profile/followButton
๐ช ๋ณ๊ฒฝ์ฌํญ
โ๏ธ PR ํฌ์ธํธ
์บ๋ฌ์ ๊ณผ profile์ ์ ์ฉํด์ฃผ์๋ฉด ์ฃผ๋ง์ ํ๋ฒ ์ ์๋ํ๋์ง ์ ๋๋ก ํ ์คํธ ํ ์ ์์ ๊ฒ ๊ฐ์ต๋๋ค!