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

[Feature/#50] detail community api #57

Open
wants to merge 21 commits into
base: develop
Choose a base branch
from

Conversation

zelkovaria
Copy link
Collaborator

@zelkovaria zelkovaria commented Oct 31, 2024

๐Ÿ“Œ ๊ณผ์ œ ์„ค๋ช…

๊ฒŒ์‹œ๋ฌผ ์ƒ์„ธ ์กฐํšŒ ํŽ˜์ด์ง€ ๊ตฌํ˜„

๐Ÿ‘ฉโ€๐Ÿ’ป ์š”๊ตฌ ์‚ฌํ•ญ๊ณผ ๊ตฌํ˜„ ๋‚ด์šฉ

  • ๋Œ“๊ธ€ ์กฐํšŒ api ์—ฐ๊ฒฐ
  • ๋Œ“๊ธ€ ์ž‘์„ฑ api ์—ฐ๊ฒฐ
  • ๊ฒŒ์‹œ๋ฌผ ์ƒ์„ธ ์กฐํšŒ์‹œ api ์—ฐ๊ฒฐ
  • ๊ฒŒ์‹œ๋ฌผ ๊ณต๊ฐ ํ† ๊ธ€

โœ… PR ํฌ์ธํŠธ & ๊ถ๊ธˆํ•œ ์ 

  • props drilling๋•Œ๋ฌธ์— ์ง€์ €๋ถ„ํ•ด๋ณด์ผ ์ˆ˜ ์žˆ์„ ๊ฒƒ ๊ฐ™์•„์š”...๐Ÿฅน ํ˜„์žฌ pr์—์„œ ์„ž์—ฌ๋ฒ„๋ฆด ๊ฒƒ ๊ฐ™์•„์„œ ์ดํ›„์— ๋ฆฌํŒฉํ„ฐ๋ง pr ์—ด์–ด์„œ ๋ฐ˜์˜ํ•ด๋‘๊ฒ ์Šต๋‹ˆ๋‹ค !! ( หƒโจห‚ฬฅฬฅ )
  • ๊ฒŒ์‹œ๋ฌผ ๊ณต๊ฐ ํ† ๊ธ€์„ ์œ„ํ•ด DetailPostContent.tsx์—์„œ likesCount๊ฐ€ ์—†์œผ๋ฉด 0์œผ๋กœ ์„ค์ •ํ•ด์ค€ ์ดํ›„๋กœ, ํ† ๊ธ€์‹œ ๊ฐ’์„ ๋ฐ˜์˜์‹œํ‚ค๊ธฐ ์œ„ํ•ด useEffect๋ฅผ ์ผ๋Š”๋ฐ์š”,, ๋” ์ข‹์€ ๋ฐฉ๋ฒ•์ด ์—†์„์ง€ ๊ณ ๋ฏผ์ด ๋ฉ๋‹ˆ๋‹ค ใ… ใ… 
  • ๋กœ๊ทธ์ธ ๊ด€๋ จ ๊ถŒํ•œ์€ ๋ณ„๋„์˜ pr์—์„œ ํ•ด๋ณผ๊ฒŒ์š”..!

Close #50

@zelkovaria zelkovaria self-assigned this Oct 31, 2024
Copy link
Collaborator

@minjeongss minjeongss left a comment

Choose a reason for hiding this comment

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

๊ถ๊ธˆํ•œ ๋ถ€๋ถ„์— ๋Œ€ํ•œ ๋ฆฌ๋ทฐ ์ž‘์„ฑํ–ˆ์Šต๋‹ˆ๋‹ค ๐Ÿ˜„
์ˆ˜๊ณ  ๋งŽ์œผ์…จ์–ด์š”~~!

@@ -39,7 +39,7 @@ const router = createBrowserRouter([
element: <CommunityPage />,
},
{
path: '/detail/community/:id',
path: '/community/post/:id',
Copy link
Collaborator

Choose a reason for hiding this comment

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

writing page์—์„œ๋„ ์ˆ˜์ •ํ• ๊ฒŒ์š”~!!

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 ํ˜•์‹๊ณผ ๋น„์Šทํ•˜๊ฒŒ ๋ฐ”๊ฟ”๋†จ์–ด์š” ๐Ÿ‘๐Ÿป

import axios from 'axios';
import { useState } from 'react';

interface CommentInputProps {
Copy link
Collaborator

Choose a reason for hiding this comment

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

์ปจ๋ฒค์…˜์— ๋”ฐ๋ผ CommentInputPropTypes๋กœ ์ˆ˜์ •ํ•˜์…”์•ผ ํ•  ๊ฒƒ ๊ฐ™์•„์š”!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

์•„์ด๊ตฌ์•ผ ์ž๊พธ ๋†“์น˜๋„ค์š”!! ใ… ใ… ใ…  ๋ฐ˜์˜ํ•ด๋‘๊ฒ ์Šต๋‹ˆ๋‹น ใ…Žใ…Ž ๊ฐ์‚ฌํ•ด์š”


const { data, refetch } = useQuery({
queryKey: ['post', id],
queryFn: () => getDetailPost(Number(id)),
Copy link
Collaborator

Choose a reason for hiding this comment

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

queryFn ๋‚ด๋ถ€์— ์“ฐ์ง€ ์•Š๊ณ  ๋‹ค๋ฅธ ํ•จ์ˆ˜๋กœ ๋ถ„๋ฆฌํ•œ ์ด์œ ๊ฐ€ ์žˆ์œผ์‹ ๊ฐ€์š”?

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 ๊ด€๋ จ ๋กœ์ง์„ ๋ถ„๋ฆฌํ•˜๋ฉด ์–ด๋Š์ •๋„ ์—ญํ• ๋„ ๋ถ„๋ฆฌ๋˜๊ณ  ๊ด€๋ จ ์˜ˆ์™ธ์ฒ˜๋ฆฌ ์‹œ์—๋„ ์œ ์šฉํ•  ๊ฒƒ ๊ฐ™๋‹ค ์ƒ๊ฐํ–ˆ์Šต๋‹ˆ๋‹ค ใ…Žใ……ใ…Ž

user_info: UserDataType;
}

export interface PostContentPropTypes {
Copy link
Collaborator

Choose a reason for hiding this comment

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

์ €๋Š” ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•  ๋•Œ propTypes์˜ ๊ฒฝ์šฐ, ํ•ด๋‹น ์ปดํฌ๋„ŒํŠธ ๋‚ด๋ถ€์— ์‚ฌ์šฉํ•˜๋Š” ํŽธ์ด ๋ฐ”๋กœ ์ดํ•ดํ•  ์ˆ˜ ์žˆ์–ด ์ปดํฌ๋„ŒํŠธ ๋‚ด๋ถ€์— ๋‘๋Š” ํŽธ์ž…๋‹ˆ๋‹ค.
type์„ ๋”ฐ๋กœ ๋ถ„๋ฆฌํ•˜์‹  ์ด์œ ๋Š” ํŒŒ์ผ์„ ๋ชจ์•„๋‘๊ธฐ ์œ„ํ•จ์ผ๊นŒ์š”?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

์ €๊ฐ™์€ ๊ฒฝ์šฐ๋Š” ๊ด€๋ จ๋œ type์ด ์ ์  ๋Š˜์–ด๋‚˜์„œ ๊ฐ€๋…์„ฑ ์ธก๋ฉด ๋•Œ๋ฌธ์— ๋ถ„๋ฆฌํ•ด๋’€์Šต๋‹ˆ๋‹ค!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

๊ณ ๋ฏผ๊ธ€ ๋””ํ…Œ์ผ ์กฐํšŒ ํŽ˜์ด์ง€
2 participants