Skip to content
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

Merged
merged 4 commits into from
Sep 23, 2023

Conversation

nayeon-hub
Copy link
Collaborator

๐Ÿช„ ๋ณ€๊ฒฝ์‚ฌํ•ญ

  1. ํŒ”๋กœ์šฐ ๋ฒ„ํŠผ์„ ๋„คํŠธ์›Œํฌ ์—๋Ÿฌ ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค.
  2. mutaton ์‚ฌ์šฉํ•˜๋‹ˆ๊นŒ ํŒ”๋กœ์šฐ ๋ฒ„ํŠผ ์—ฐ์†์œผ๋กœ ๋ˆŒ๋Ÿฌ๋„ ์ž˜๋ฉ๋‹ˆ๋‹ค ํ˜ธํ˜ธํ˜ธ
  3. ์บ๋Ÿฌ์…€ ํƒญ ์ˆœ์„œ๊ฐ€ ํ˜„์žฌ๋Š” following, follwer๋กœ ๋˜์–ด์žˆ๋Š”๋ฐ ์ธ์Šคํƒ€ ์ฒ˜๋Ÿผ follwer, following ์ˆœ์„œ๋กœ ๋‘˜๊นŒ์š”?

โœ๏ธ PR ํฌ์ธํŠธ

์บ๋Ÿฌ์…€๊ณผ profile์— ์ ์šฉํ•ด์ฃผ์‹œ๋ฉด ์ฃผ๋ง์— ํ•œ๋ฒˆ ์ž˜ ์ž‘๋™ํ•˜๋Š”์ง€ ์ œ๋Œ€๋กœ ํ…Œ์ŠคํŠธ ํ•  ์ˆ˜ ์žˆ์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค!

Copy link
Collaborator

@hyesung99 hyesung99 left a 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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ €๋Š” 'bearer ' ๋ถ€๋ถ„์„ api๋‹จ์ด ์•„๋‹Œ UI๋ ˆ์ด์–ด์—์„œ ๋ถ™์—ฌ์„œ ๋ณด๋‚ด์ฃผ๋Š”๋ฐ ํ†ต์ผํ•ด์•ผ๊ฒ ๋„ค์š”?! ์–ด๋Š์ชฝ์ด ๋” ์ข‹์„๊นŒ์š”?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

api๋‹จ์ด ๋” ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”! ์•„๋‹ˆ๋ฉด ์„ธ์…˜์— ์ €์žฅํ•  ๋•Œ bearer์„ ๋ถ™์ด๊ณ  ์ €์žฅํ•˜๋Š”๊ฑด ์–ด๋–จ๊นŒ์š”?

Comment on lines 21 to +28
const [userSessionData] = useSessionStorage<Pick<User, '_id' | 'token'>>(
'userData',
{
_id: '',
token: ''
}
);
const { token, _id } = userSessionData;
const { token } = userSessionData;
Copy link
Collaborator

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: ''
    }
  );

์„ธ์…˜์—์„œ ํ† ํฐ๋งŒ ๊ฐ€์ ธ์˜จ๋‹ค๋ฉด ์ด๋ ‡๊ฒŒ ์ž‘์„ฑํ•ด์ฃผ์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค!

Copy link
Member

@sscoderati sscoderati left a 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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default ๊ฐ’์„ ๋ถ€์—ฌํ•˜๊ณ  ์žˆ์–ด์„œ ์˜ต์…”๋„๋กœ ์ฒ˜๋ฆฌํ•˜์ง€ ์•Š์œผ์…”๋„ ๊ดœ์ฐฎ์ง€ ์•Š์„๊นŒ์š”?

Comment on lines +9 to +10
followingDataId: string; // ์‚ญ์ œ์šฉ - following data id
followingUserId: string; // ํŒ”๋กœ์šฐ์šฉ - ํŒ”๋กœ์šฐํ•  userId
Copy link
Member

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

๊ฐœ์ธ์ ์œผ๋กœ๋Š” ์ด๊ฒŒ ๋” ์ง๊ด€์ ์œผ๋กœ ๋ณด์—ฌ์„œ ์ œ์•ˆ๋“œ๋ ธ๋Š”๋ฐ ์–ด๋–ป๊ฒŒ ์ƒ๊ฐํ•˜์‹œ๋‚˜์šฉ

Copy link
Collaborator Author

@nayeon-hub nayeon-hub Sep 23, 2023

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 ๋ฐ์ดํ„ฐ ์•„์ด๋””๋ž๋‹ˆ๋‹ค.. ใ… ใ… 

@nayeon-hub nayeon-hub merged commit d2095db into main Sep 23, 2023
@nayeon-hub nayeon-hub deleted the feat/profile/followButton branch September 23, 2023 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants