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

Use suspense query error/#120 #121

Merged
merged 11 commits into from
Jun 30, 2024
Merged

Use suspense query error/#120 #121

merged 11 commits into from
Jun 30, 2024

Conversation

gahyuun
Copy link
Member

@gahyuun gahyuun commented Jun 16, 2024

๐Ÿ“Œ ์ž‘์—… ๋‚ด์šฉ

๊ตฌํ˜„ ๋‚ด์šฉ ๋ฐ ์ž‘์—… ํ–ˆ๋˜ ๋‚ด์—ญ

  • ํ๊ฐ• ๊ณผ๋ชฉ ์ฒ˜๋ฆฌ ๋ฐ taken lecture type ์ˆ˜์ • ( ์ง€๋‚œ๋ฒˆ pr )
  • fetch user ( ํšŒ์› ์ •๋ณด ์กฐํšŒ ) completionDivision -> completeDivision
  • delete taken lecture, add taken lecture๋Š” ๋ฐฑ์—”๋“œ๋กœ๋ถ€ํ„ฐ ์‘๋‹ต ๋ฐ์ดํ„ฐ๊ฐ€ ์—†๋Š”๋ฐ http Error handler์—์„œ๋Š” ์‘๋‹ต ๋ฐ์ดํ„ฐ๋ฅผ ๊ผญ ๋„ฃ์–ด์ค˜์•ผ ํ•จ ๊ทธ๋ž˜์„œ error throw๋ฅผ ํ•˜๊ธฐ์— ์• ๋งคํ•ด์ง ํ•˜์ง€๋งŒ ์ด ์ด์Šˆ๋Š” next fetch๋กœ ๋ณ€๊ฒฝํ•˜๋ฉด์„œ ๋ฐ”๋€” ๋ถ€๋ถ„์ด๋ผ๊ณ  ์ƒ๊ฐ๋˜๊ธฐ์— ๋™์ž‘๋งŒ ๋˜๋„๋ก ์ฝ”๋“œ๋ฅผ ์ˆ˜์ •

๐Ÿ”Š ๋„์›€์ด ํ•„์š”ํ•œ ๋ถ€๋ถ„

์•„๋ž˜ ๋ฌธ์ œ๋“ค์€ next build ํ›„ ์‹คํ–‰ํ–ˆ์„ ๋•Œ ๋ฐœ์ƒํ–ˆ๋˜ ๋ฌธ์ œ์ž…๋‹ˆ๋‹ค

  • ํ† ํฐ์ด ํ•„์š”ํ•œ my page๋‚˜ result page ์ง„์ž… ์‹œ 500 ์—๋Ÿฌ , ํ† ํฐ์ด ์žˆ์Œ์—๋„ ์•„์˜ˆ ์ง„์ž… ๋ถˆ๊ฐ€๋Šฅํ–ˆ์Šต๋‹ˆ๋‹ค
  • ํ˜น์‹œ ๋ชฐ๋ผ์„œ middleware.ts ํŒŒ์ผ์„ ์‚ญ์ œํ•ด๋ณด๋‹ˆ ์‹คํ–‰์ด ์ž˜๋˜์—ˆ๊ณ  middleware์—์„œ ๋ญ”๊ฐ€ ์ด์Šˆ๊ฐ€ ์žˆ์—ˆ๋˜ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค ์ œ๊ฐ€ ์‹œ๊ฐ„์ด ์—†์–ด์„œ ์ด ๋ถ€๋ถ„๊นŒ์ง€ ํ™•์ธ์„ ํ•˜์ง€ ๋ชปํ–ˆ์Šต๋‹ˆ๋‹ค ํ•œ ๋ฒˆ ํ™•์ธ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค!
  • get Token ํ•จ์ˆ˜๊ฐ€ use server ์„ ์–ธ์œผ๋กœ ์ธํ•ด async ํ‚ค์›Œ๋“œ๊ฐ€ ํ•„์š”ํ•˜๋”๋ผ๊ตฌ์š”. ์ด ๋ถ€๋ถ„ ๋ณ€๊ฒฝํ–ˆ์Šต๋‹ˆ๋‹ค
  • ์ œ๊ฐ€ ํ˜„์žฌ ํ™•์ธํ•œ ๋ถ€๋ถ„์€ middleware์„ ์‚ญ์ œํ•œ ์ƒํƒœ์—์„œ build ํ›„ my page ์ง„์ž… ์‹œ my page์˜ user Info navigator ( ์™ผ์ชฝ ํšŒ์› ์ •๋ณด ๋ถ€๋ถ„) ์„ ์ œ์™ธํ•˜๊ณ  ๋ชจ๋‘ ์ •์ƒ์ ์œผ๋กœ ๋Œ์•„๊ฐ€๋Š” ๊ฒƒ์„ ํ™•์ธํ–ˆ์Šต๋‹ˆ๋‹ค . user info navigator๊ฐ€ ์˜ค๋ฅ˜๋‚˜๋Š”๊ฑด ์•„๋‹ˆ๊ณ  ๋‹จ์ง€ ์ฃผ์„ํ–ˆ์Šต๋‹ˆ๋‹ค
  • use Suspense Query ๊ด€๋ จํ•œ ๋ฌธ์ œ๊ฐ€ ์ €ํ•œํ… ๋ฐœ์ƒํ•˜์ง€ ์•Š์•˜๋Š”๋ฐ ๋‹ค์‹œ ํ•œ ๋ฒˆ ํ™•์ธํ•ด์ฃผ์‹ค ์ˆ˜ ์žˆ์„๊นŒ์š”?

@gahyuun gahyuun self-assigned this Jun 16, 2024
@yougyung
Copy link
Member

์ˆ˜๊ณ ํ•˜์…จ์Šต๋‹ˆ๋‹ค. layout.tsx์˜ <MSWComponent>๋ฅผ ์ œ๊ฑฐํ•œ ์ดํ›„์—๋„ use Suspense Query ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•˜์ง€์•Š์•˜๋‚˜์š”?

yougyung
yougyung previously approved these changes Jun 17, 2024
Copy link

Copy link
Collaborator

@seonghunYang seonghunYang left a comment

Choose a reason for hiding this comment

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

  • ์ˆ˜๊ณ ํ•˜์…จ์Šต๋‹ˆ๋‹ค

@gahyuun gahyuun merged commit c1bef52 into main Jun 30, 2024
2 of 3 checks passed
@gahyuun gahyuun deleted the use-suspense-query-error/#120 branch June 30, 2024 22:42
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