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

[장문원] week20 #491

Conversation

jangmoonwon
Copy link
Collaborator

주요 변경사항

  • react query 사용

멘토에게

  • api로 불러오는 데이터에 fetch 함수에서 react-query로 변경하였습니다. 쿼리 수업을 들으면서 다양한 기능이 많은 것 같은데 아직 어렵더라구요..
  • 폴더페이지에 폴더인포부분에 아직 react-query로 변경하지 못하였습니다.

@jangmoonwon jangmoonwon requested a review from kich555 June 30, 2024 09:37
Copy link
Collaborator

@kich555 kich555 left a comment

Choose a reason for hiding this comment

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

👍👍👍
리엑트쿼리는 아직 기본적인 것만 사용중이시긴 하지만
잘 사용하고 계신것 같네요

고생하셨습니다!

const response = await axiosInstance.get("/users/1/folders");
const data: Data[] = response.data;
return data;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

AS-IS

export async function getFolders(): Promise<Data[]> {
  const response = await axiosInstance.get("/users/1/folders");
  const data: Data[] = response.data;
  return data;
}

TO-BE

export async function getFolders(params: { userId: number }): Promise<Data[]> {
  const { userId } = params;
  const response = await axios.get<Data[]>(`/users/${userId}/folders`);
  return response.data;
}

const response = await axiosInstance.get("/users/1/links");
const data: Data[] = response.data;
return data;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

AS-IS

export async function getLinks(): Promise<Data[]> {
  const response = await axiosInstance.get("/users/1/links");
  const data: Data[] = response.data;
  return data;
}

TO-BE

export async function getLinks(params: { uesrId: number }): Promise<Data[]> {
  const { uesrId } = params;
  const response = await axios.get<Data[]>(`/users/${uesrId}/links`);

  return response.data;
}

</>
) : (
<h1>데이터가 없습니다</h1>
)}
Copy link
Collaborator

Choose a reason for hiding this comment

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

<h1> 태그는 html파일 하나당 1개만 존재해야해요!

책에 제목이 여러개일수는 없듯이요 ㅎ

@kich555 kich555 merged commit da64e98 into codeit-bootcamp-frontend:part3-장문원 Jun 30, 2024
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.

2 participants