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

Result fetch/#92 #95

Merged
merged 19 commits into from
May 7, 2024
Merged

Result fetch/#92 #95

merged 19 commits into from
May 7, 2024

Conversation

yougyung
Copy link
Member

@yougyung yougyung commented May 2, 2024

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

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

  • ๊ธฐ์กด getUserInfo๊ฐ€ ํšŒ์› ๊ฐ€์ž… ๋“ฑ์˜ ๋กœ์ง์— ๊ด€๋ จ๋œ ๋ถ€๋ถ„์ด ์กด์žฌํ•˜๋Š” ๊ฒƒ์œผ๋กœ ๋ณด์—ฌ getUserInfo๋ฅผ ์ˆ˜์ •ํ•˜์ง€ ์•Š๊ณ  getResultUserInfo๋ฅผ ์ƒˆ๋กญ๊ฒŒ ์ƒ์„ฑํ–ˆ์Šต๋‹ˆ๋‹ค.
  • Result page์— ๋Œ€ํ•œ data fetching์ž‘์—…์„ ์ง„ํ–‰ํ–ˆ์Šต๋‹ˆ๋‹ค.
  • ๋‹ค์ „๊ณตํ‘œ๊ธฐ, ์ฑ„ํ”Œ ํ•™์  ๋ณ€ํ™˜ ์ž‘์—… ํ•จ๊ป˜ ์ง„ํ–‰ํ–ˆ์Šต๋‹ˆ๋‹ค.

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

@yougyung yougyung self-assigned this May 2, 2024
seonghunYang
seonghunYang previously approved these changes May 2, 2024
@yougyung yougyung dismissed seonghunYangโ€™s stale review May 2, 2024 10:33

The merge-base changed after approval.

Copy link

github-actions bot commented May 2, 2024

Copy link
Member

@gahyuun gahyuun left a comment

Choose a reason for hiding this comment

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

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


interface ResultPageProp {
searchParams: { category: string };
}

function ResultPage({ searchParams }: ResultPageProp) {
async function ResultPage({ searchParams }: ResultPageProp) {
Copy link
Member

Choose a reason for hiding this comment

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

async ํ‚ค์›Œ๋“œ๋ฅผ ๋„ฃ์€ ์ด์œ ๋ฅผ ์„ค๋ช…ํ•ด์ฃผ์‹ค ์ˆ˜ ์žˆ๋‚˜์š”?

Copy link
Member Author

Choose a reason for hiding this comment

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

๊ธฐ์กด ๊ตฌ์กฐ์—์„œ๋Š” data fetching์„ ํ•ด๋‹น ์ปดํฌ๋„ŒํŠธ์—์„œ ์ง„ํ–‰ํ–ˆ๋Š”๋ฐ, ๊ตฌ์กฐ ๋ณ€๊ฒฝ์ด ๋ฐœ์ƒํ•˜๋ฉด์„œ ์ˆ˜์ •์„ ๋ˆ„๋ฝํ•œ ๋ถ€๋ถ„๊ฐ™์Šต๋‹ˆ๋‹ค. ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค. 02a1e0f

Comment on lines +31 to +46
export async function fetchResultUserInfo(): Promise<ResultUserInfo> {
try {
const response = await fetch(API_PATH.resultUserInfo, {
headers: {
Authorization: `Bearer ${cookies().get('accessToken')?.value}`,
},
});

const result = await response.json();

httpErrorHandler(response, result);
return result;
} catch (error) {
throw error;
}
}
Copy link
Member

Choose a reason for hiding this comment

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

ํšŒ์›๊ฐ€์ž… ๋กœ์ง์œผ๋กœ ์ธํ•ด fetch Result userInfo๋ฅผ ๋งŒ๋“œ์…จ๋‹ค๊ณ  ํ•˜์…จ๋Š”๋ฐ, ํ˜น์‹œ ์ด๋กœ ์ธํ•ด ์–ด๋–ค ๋ฌธ์ œ๊ฐ€ ์žˆ์—ˆ๋Š”์ง€ ์•Œ๋ ค์ฃผ์‹ค ์ˆ˜ ์žˆ๋‚˜์š”!?
์ €๋Š” getUserInfo๋ฅผ ์žฌ์‚ฌ์šฉํ–ˆ์–ด์„œ์š”..!

Copy link
Member Author

Choose a reason for hiding this comment

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

ํ˜„์žฌ mock data์™€ ์‹ค์ œ backend์—์„œ ์ „์†กํ•ด์ฃผ๋Š” ๏ฟฝtype์ด ์ผ์น˜ํ•˜์ง€ ์•Š์•„(๋‹ค์ „๊ณต ๋“ฑ์˜ ์‚ฌ์œ ๋กœ ๋ณ€๊ฒฝ๋˜์—ˆ์Šต๋‹ˆ๋‹ค) UserInfo type์„ ๋ณ€๊ฒฝํ•ด์ฃผ๋Š” ๊ณผ์ •์ด ํ•„์š”ํ–ˆ์Šต๋‹ˆ๋‹ค. englishlevel studentID ๋“ฑ์˜ ์†์„ฑ์€ ํšŒ์›๊ฐ€์ž… ๊ณผ์ •์—์„œ ์‚ฌ์šฉ๋˜๋Š” ์†์„ฑ์ด๋ผ๋Š” ์ƒ๊ฐ์ด ๋“ค์–ด์„œ, type์„ ์ œ๊ฐ€ ์ž„์˜๋กœ ๋ณ€๊ฒฝํ•˜์ง€ ์•Š๊ณ  ์ƒˆ๋กญ๊ฒŒ ์ƒ์„ฑํ–ˆ์Šต๋‹ˆ๋‹ค

@@ -54,7 +66,7 @@ function ResultCategoryCard({ category, totalCredit, takenCredit }: ResultCatego
<Image src={Book} width={24} height={24} alt="category-img" />
<h3>{RESULT_CATEGORY_KO[category]}</h3>
</div>
{filterSeveralMajor(category)}
{displaySeveralMajor(category)}
Copy link
Member

Choose a reason for hiding this comment

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

filter๋ฅผ display๋กœ ๋ณ€๊ฒฝํ•ด์„œ ๋” ๋ช…ํ™•ํ•ด์ง„ ๊ฒƒ ๊ฐ™๋„ค์š”!

Comment on lines 78 to 79
<span className="font-bold">{takeCategoryCredit(category, totalCredit)}</span>
</div>
Copy link
Member

Choose a reason for hiding this comment

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

์ด์ˆ˜ ํ•™์ ์„ ๊ฐ€์ ธ์˜ค๊ธฐ ์œ„ํ•ด takenCategoryCredit์ด๋ผ๋Š” ๋„ค์ด๋ฐ์„ ์‚ฌ์šฉํ•˜์‹  ๊ฒƒ ๊ฐ™์€๋ฐ getCategoryCredit์ด๋‚˜ caculateCategoryCredit ์€ ์–ด๋– ์‹ ๊ฐ€์š”?!

Copy link
Member Author

Choose a reason for hiding this comment

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

๊ฐœ๋ฐœ์„ ์ง„ํ–‰ํ•  ๋‹น์‹œ์—๋Š” ์ฑ„ํ”Œ category์˜ ๊ฒฝ์šฐ์—๋งŒ *2๋ฅผ ํ†ตํ•ด ํ•™์ ์„ ์ทจ๋“ํ•˜๋ฏ€๋กœ ์†Œ์œ ์˜ ์˜๋ฏธ๋ฅผ get๋ณด๋‹ค ๊ฐ•ํ•˜๊ฒŒ ์ „๋‹ฌํ•˜๊ธฐ ์œ„ํ•ด์„œ take๋ฅผ ์‚ฌ์šฉํ•˜์˜€๋Š”๋ฐ, ๋‹ต๋ณ€์„ ์ž‘์„ฑํ•˜๋ฉด์„œ CategoryCredit์ž์ฒด๊ฐ€ category๋ณ„ credit์— ๋Œ€ํ•œ ์˜๋ฏธ๋ฅผ ํฌํ•จํ•˜๋ฏ€๋กœ get์ด ๋” ์ ์ ˆํ•  ์ˆ˜ ์žˆ๊ฒ ๋‹ค๋Š” ์ƒ๊ฐ์ด ๋“œ๋„ค์š”. ์˜๊ฒฌ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค. e795740

Copy link
Member

Choose a reason for hiding this comment

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

user-info-card, user-info-naviagtor ์˜๋ฏธ๊ฐ€ ๋ชจํ˜ธํ•  ์ˆ˜๋„ ์žˆ์ง€์•Š๋‚˜? ๋ผ๋Š” ์ƒ๊ฐ์ด ๋“œ๋„ค์š”
์–ด๋–ค ์ด๋ฆ„์ด ์ข‹์„์ง„ ์ €๋„ ๋”ฑ ์•„์ด๋””์–ด๊ฐ€ ๋– ์˜ค๋ฅด์ง„ ์•Š์ง€๋งŒ ์ƒ๊ฐํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค!

@@ -4,7 +4,7 @@ import logo from '../../../../public/assets/logo.svg';
export default function NavigationBar() {
return (
<div className="absolute p-4 border-b-[1px] w-full">
<Image className="md:h-10 h-7 w-[110px] md:w-[150px]" width={150} height={100} src={logo} alt="main-logo" />
{/* <Image className="md:h-10 h-7 w-[110px] md:w-[150px]" width={150} height={100} src={logo} alt="main-logo" /> */}
Copy link
Member

Choose a reason for hiding this comment

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

์ฃผ์„์ฒ˜๋ฆฌํ•˜์‹  ์ด์œ ๊ฐ€ ์žˆ๋‚˜์š”?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link

github-actions bot commented May 3, 2024

Copy link

github-actions bot commented May 3, 2024

Copy link

github-actions bot commented May 3, 2024

app/ui/user/user-info-card/user-info-card.tsx Outdated Show resolved Hide resolved
major: string;
}

export interface ResultUserInfo {
Copy link
Collaborator

Choose a reason for hiding this comment

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

  • ์ด ๋ถ€๋ถ„ ๊ฐ€ํ˜„์ด PR๊ณผ ์ค‘๋ณต๋˜๋Š” ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ๋‘ ๋ถ„์ด ํ†ตํ•ฉ ๊ณ„ํš์ด ์žˆ์„๊นŒ์š”?

Copy link
Member Author

Choose a reason for hiding this comment

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

๊ธฐ์กด์— Mock data๋กœ ํ™œ์šฉ๋˜๊ณ  ์žˆ๋Š” user์™€ ์‹ค์ œ ์‘๋‹ต๋ฐ›๋Š” data์˜ ์ฐจ์ด๋กœ ์ธํ•ด ๋ถ„๋ฆฌ ๋ฐ ํ†ตํ•ฉํ•˜๋Š” ์ฝ”๋“œ๋กœ ๋ฆฌํŒฉํ† ๋ง์„ ์ง„ํ–‰ํ•  ์˜ˆ์ •์ž…๋‹ˆ๋‹ค.
๊ธฐ์กด์—๋Š” ๋™์ผ PR์— ์ž‘์—…์„ ์ง„ํ–‰ํ•  ๊ณ„ํš์ด์—ˆ์œผ๋‚˜ ๋ณด๋‹ค ์ž์„ธํ•œ ๊ฐœ๋ฐœ ๊ณผ์ •์— ๋Œ€ํ•œ ๊ณต์œ ๋ฅผ ์œ„ํ•ด ๋ณ„๋„์˜ PR๋กœ ๋ถ„๋ฆฌํ•ด์„œ ์˜ฌ๋ฆฌ๋„๋กํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค!

app/business/result/result.query.ts Outdated Show resolved Hide resolved
Copy link

github-actions bot commented May 6, 2024

Copy link

github-actions bot commented May 6, 2024

Copy link

github-actions bot commented May 6, 2024

Copy link

github-actions bot commented May 6, 2024

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.

  • ์ˆ˜๊ณ  ๋งŽ์•˜์–ด์š”

@yougyung yougyung merged commit 4c2c89a into main May 7, 2024
2 of 3 checks passed
@yougyung yougyung deleted the result-fetch/#92 branch May 7, 2024 11:40
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