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

๐ŸŽ‰ ์ œ์•ˆ ์š”์ฒญ, ์นด๋“œ ์‚ญ์ œ api ์—ฐ๊ฒฐ ์™„๋ฃŒ #91

Merged
merged 8 commits into from
Nov 22, 2023

Conversation

juyeon-park
Copy link
Contributor

- ๋ชฉ์ 

๊ด€๋ จ ํ‹ฐ์ผ“ ๋ฒˆํ˜ธ: 238


- ์ฃผ์š” ๋ณ€๊ฒฝ ์‚ฌํ•ญ

  • ์นด๋“œ ์‚ญ์ œ api ์—ฐ๊ฒฐ์™„๋ฃŒ
  • ์ œ์•ˆ ์š”์ฒญ api ์—ฐ๊ฒฐ์™„๋ฃŒ
  • ์ƒ์„ธ ์ •๋ณด ํŽ˜์ด์ง€์—์„œ ๋‚ด ๋ฌผ๊ฑด์ผ ๊ฒฝ์šฐ ๋”๋ณด๊ธฐ ๋ฒ„ํŠผ ์•ˆ๋‚˜์˜ค๋˜ ๋ฒ„๊ทธ ์ˆ˜์ •
  • ์ƒ์„ธ ์ •๋ณด ํŽ˜์ด์ง€์—์„œ ๋‚ด ๋ฌผ๊ฑด์ผ ๊ฒฝ์šฐ ์ œ์•ˆํ™•์ธ ๋ฒ„ํŠผ์„ ๋ˆ„๋ฅด๋ฉด ์ œ์•ˆํ™•์ธ ํŽ˜์ด์ง€๋กœ ์ด๋™ํ•˜๋„๋ก ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค.
  • ๋‚ด ๋ฌผ๊ฑด์ด ์•„๋‹๋•Œ๋งŒ ์ œ์•ˆ๊ฐ€๋Šฅํ•œ ์นด๋“œ๋ฅผ ๊ฐ€์ ธ์˜ค๋„๋ก useSuggestionsQuery์— enabled ์†์„ฑ ์ถ”๊ฐ€

๊ธฐํƒ€ ์‚ฌํ•ญ (์„ ํƒ)

  • ๋™ํ˜„๋‹˜๊ป˜์„œ ์ง€๋‚œ๋ฒˆ์— suggest-> suggestion์œผ๋กœ ํ†ต์ผํ•˜์ž๊ณ  ํ•ด์ฃผ์‹  ๊ฒƒ ๋ฐ˜์˜ํ•ด์„œ ํŒŒ์ผ๋ช… useSuggestMutation.ts -> useSuggestionUpdateMutation.ts๋กœ ๋ณ€๊ฒฝํ–ˆ์Šต๋‹ˆ๋‹ค.
  • ์ด๋ฒˆ์—” ๋ฆฌ๋ทฐ ๋‹ต๋ณ€ pending ์ƒํƒœ์ธ์ง€ ํ™•์ธํ•˜๊ณ  start review ๊ผญ ๋ˆ„๋ฅด๊ฒ ์Šต๋‹ˆ๋‹ค ๐Ÿฅฒ

- ์Šคํฌ๋ฆฐ์ƒท (์„ ํƒ)

  • ๋ณด๊ณ ์žˆ๋Š” ์ƒํ’ˆ์— ์ œ์•ˆํ•  ์ˆ˜ ์žˆ๋Š” ๋‚ด ์นด๋“œ๊ฐ€ ์—†์„ ๊ฒฝ์šฐ
image
  • ๋ณด๊ณ ์žˆ๋Š” ์ƒํ’ˆ์— ์ œ์•ˆํ•  ์ˆ˜ ์žˆ๋Š” ๋‚ด ์นด๋“œ๊ฐ€ ์žˆ์„ ๊ฒฝ์šฐ
image
  • ์˜คํผํ•˜๊ธฐ๋ฅผ ๋ˆŒ๋ €์„ ๋•Œ์˜ ui
image

@juyeon-park juyeon-park self-assigned this Nov 21, 2023
@@ -77,13 +77,12 @@ const TradeSection = ({

const onClickButton = async () => {
if (isMyItem) {
alert('์ œ์•ˆํ™•์ธ ํŽ˜์ด์ง€๋กœ ์ด๋™ํ•˜๊ธฐ')
router.push(`/mypage/suggestions/${cardId}`)
Copy link
Contributor

Choose a reason for hiding this comment

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

์ด๋ฒˆ ์ œ PR์— AppPath.mySuggestions ์˜ฌ๋ ค๋‘์—ˆ์Šต๋‹ˆ๋‹ค! ์ฐจํ›„์— ์ ์šฉํ•˜์‹œ๋ฉด ๋  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

์˜ค AppPath์— ์žˆ์—ˆ๊ตฐ์š”! ๋ฐ”๋กœ ์ˆ˜์ •ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค!

Copy link
Contributor Author

@juyeon-park juyeon-park Nov 22, 2023

Choose a reason for hiding this comment

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

appPathํŒŒ์ผ์„ ๋ณด๋‹ˆ ๋‚ด ์ œ์•ˆํ™•์ธ ํŽ˜์ด์ง€์˜ ๋ฃจํŠธ๊ฐ€ ์ด๋ ‡๊ฒŒ ์„ค์ •๋˜์–ด ์žˆ๋”๋ผ๊ณ ์š”!

mySuggestions: () => '/mypage/suggestions` as const,

์นด๋“œ ์•„์ด๋””๊ฐ€ ์Šฌ๋Ÿฌ๊ทธ ํ˜•ํƒœ์—ฌ์„œ ๋งค๊ฐœ๋ณ€์ˆ˜์— cardId๋ฅผ ๋ฐ›๊ฒŒ ์ด๋ ‡๊ฒŒ ๊ณ ์ณค์Šต๋‹ˆ๋‹ค! ๊ดœ์ฐฎ์„๊นŒ์š”? MyCard.tsx์˜ ๋งํฌ ์ฃผ์†Œ๋„ ์ˆ˜์ •ํ•ด๋†จ์Šต๋‹ˆ๋‹ค!

mySuggestions: (cardId: number) => `/mypage/suggestions/${cardId}` as const

@@ -30,7 +30,7 @@ const SuggestCard = ({
toCardId,
suggestionStatus,
}: SuggestCardProps) => {
const { mutate } = useSuggestMutation(toCardId, fromCardId)
const { mutate } = useSuggestionUpdateMutation(toCardId, fromCardId)
Copy link
Contributor

Choose a reason for hiding this comment

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

ํ•ด๋‹น ์ฟผ๋ฆฌ๋Š” post API๋ฅผ ํ˜ธ์ถœํ•˜๊ณ  ์žˆ์œผ๋ฏ€๋กœ, update ๋ณด๋‹จ Create ๊ฐ€ ๋” ์–ด์šธ๋ฆฌ๋Š” ์ด๋ฆ„์ธ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

์˜ค ์ข‹์€ ์˜๊ฒฌ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค. post๋‹ˆ๊นŒ create๋‚˜ post๊ฐ€ ๋” ์ข‹๊ฒ ๋„ค์š” ๐Ÿ‘

Comment on lines 23 to 26
const updateSuggestions: any = structuredClone(previousSuggestions)
console.log(updateSuggestions)
//๋‚™๊ด€์  ์—…๋ฐ์ดํŠธ
const indexToUpdate = updateSuggestions.findIndex(
(card: AvailableCardSuggestionListRes) =>
Copy link
Contributor

Choose a reason for hiding this comment

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

์ €๋ฒˆ์— ์•ˆ๋๋˜ ๋ฌธ์ œ๊ฐ€ ํ˜น์‹œ structuredClone ์„ ์•ˆ์จ์„œ ๊ทธ๋Ÿฐ๊ฒŒ ๋งž๋‚˜์š”?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

๋„ต ๋งž์Šต๋‹ˆ๋‹ค! ๊นŠ์€ ๋ณต์‚ฌ๋ฅผ ํ•˜์ง€ ์•Š์•„์„œ ์ƒ๊ธด ๋ฌธ์ œ์˜€์Šต๋‹ˆ๋‹ค

Comment on lines +38 to +41
{},
{
'Content-Type': 'application/json',
},
Copy link
Contributor

Choose a reason for hiding this comment

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

๋•๋ถ„์— ์•ˆ ํ—ค๋งค๊ณ , ์ œ ํ•จ์ˆ˜์—๋„ ์ ์šฉํ–ˆ์Šต๋‹ˆ๋‹ค.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

๊ทฃ~ ๐Ÿ‘

@juyeon-park juyeon-park merged commit 776fbdd into develop Nov 22, 2023
2 checks passed
@juyeon-park juyeon-park deleted the NABI-238 branch November 22, 2023 05:47
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.

3 participants