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

๐ŸŽ‰ ๊ฑฐ๋ž˜ ์ œ์•ˆ ๋กœ์ง ๊ตฌํ˜„ #67

Merged
merged 9 commits into from
Nov 13, 2023

Conversation

juyeon-park
Copy link
Contributor

- ๋ชฉ์ 

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


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

  • useQuery, useMutation์ด์šฉํ•ด์„œ ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ค๋„๋ก ๋ณ€๊ฒฝํ–ˆ์Šต๋‹ˆ๋‹ค
  • ํ˜„์žฌ useMutation์˜ ๋‚™๊ด€์ ์—…๋ฐ์ดํŠธ ๋ถ€๋ถ„์ด ์ œ๋Œ€๋กœ ์ž‘๋™์€ ํ•˜๋Š”๋ฐ UI์ƒ์˜ ๋ณ€ํ™”(์ œ์•ˆ๋จ์œผ๋กœ ๋ฐ”๋€Œ๋Š” ๋ณ€ํ™”)๋Š” ์—†๋Š” ๋ฒ„๊ทธ๊ฐ€ ์žˆ์–ด์„œ ํ•ด๊ฒฐํ•˜๋Š” ์ค‘์ž…๋‹ˆ๋‹ค. -> ๊ณ„์† ์•ˆ๋˜๋ฉด ์ด์Šˆ๋กœ ์“ฐ๊ฒ ์Šต๋‹ˆ๋‹ค!
  • onMutate๋ฅผ ์‚ฌ์šฉํ•ด์„œ api ์š”์ฒญ์ด ์‹คํŒจํ–ˆ์„ ๊ฒฝ์šฐ ์ด์ „์˜ ์บ์‹œ๋ฅผ ๊ฐ€์ ธ์™€์„œ ๋กค๋ฐฑํ•˜๋„๋ก ๊ตฌํ˜„ํ–ˆ์Šต๋‹ˆ๋‹ค.

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


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

@juyeon-park juyeon-park self-assigned this Nov 11, 2023
@juyeon-park juyeon-park added ์ž‘์—… ์ค‘ ์•„์ง ์ž‘์—… ์ค‘์ด๋‹ˆ ๋ฆฌ๋ทฐํ•˜์ง€ ๋ง์•„์ฃผ์„ธ์š”. D-0 and removed ์ž‘์—… ์ค‘ ์•„์ง ์ž‘์—… ์ค‘์ด๋‹ˆ ๋ฆฌ๋ทฐํ•˜์ง€ ๋ง์•„์ฃผ์„ธ์š”. labels Nov 11, 2023
Copy link
Contributor

@doggopawer doggopawer left a comment

Choose a reason for hiding this comment

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

์ฃผ์—ฐ๋‹˜, ์ฝ”๋“œ ์ž‘์„ฑํ•˜์‹œ๋Š๋ผ ๊ณ ์ƒํ•˜์…จ์Šต๋‹ˆ๋‹ค!

</TabsList>
{['offer', 'poke'].map((type) => (
{['OFFER', 'POKE'].map((type) => (
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.

Tab Content์˜ ๋‚ด์šฉ์ด ๋งŽ์•„์„œ ํ’€์–ด์„œ ์“ฐ์ง€ ์•Š๊ณ  map์œผ๋กœ ๋ฌถ์—ˆ์Šต๋‹ˆ๋‹ค!

import { postSuggestion } from '@/services/suggest/suggest'
import { ItemSuggestion } from '@/types'

const useSuggestMutation = (toCardId: number, fromCardId: number) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

useSuggestMutation ๊ฐ™์€ ๊ฒฝ์šฐ ๊ธฐ์กด ์ƒํƒœ๋ฅผ ์—…๋ฐ์ดํŠธ ํ•˜๋Š”๊ฒƒ์œผ๋กœ ๋ณด์ด๋Š”๋ฐ
ํ•จ์ˆ˜๋ช…์„ useSuggestUpdateMutation์œผ๋กœ ํ•˜๋Š”๊ฒŒ ๋” ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค!

Comment on lines +27 to +33
const indexToUpdate = previousSuggestions.findIndex(
(suggestion) => suggestion.cardId === fromCardId,
)
updateSuggestions[indexToUpdate].suggestionStatus = 'WAITING'
queryClient.setQueryData(queryKey, updateSuggestions)

return { previousSuggestions }
Copy link
Contributor

Choose a reason for hiding this comment

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

ํ˜น์‹œ UI๊ฐ€ ๋ฐ”๋€Œ์ง€ ์•Š๋Š” ์ด์Šˆ๊ฐ€ ํ•ด๊ฒฐ๋˜์…จ๋‚˜์š”?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

๋„ต!! ํ•ด๊ฒฐ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ์›๋ณธ ๋ฐ์ดํ„ฐ๋ฅผ ๊นŠ์€ ๋ณต์‚ฌํ•˜์—ฌ ํ•ด๊ฒฐํ•˜์˜€์Šต๋‹ˆ๋‹ค.

Copy link
Collaborator

@oaoong oaoong left a comment

Choose a reason for hiding this comment

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

actions ๊ฒฐ๊ณผ๋ฅผ ๋‹ค์‹œ ํ™•์ธํ•ด์ฃผ์„ธ์š”. -์ž๋™์œผ๋กœ ์ž‘์„ฑ๋จ-

@juyeon-park juyeon-park merged commit 9df716c into develop Nov 13, 2023
2 checks passed
@juyeon-park juyeon-park deleted the NABI-163 branch November 13, 2023 06:08
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