Skip to content

Conversation

@kimtaejin3
Copy link
Collaborator

@kimtaejin3 kimtaejin3 commented May 8, 2024

요구사항

기본

  • https://bootcamp-api.codeit.kr/docs/linkbrary/v1 문서를 참고해 https://bootcamp-api.codeit.kr/api/linkbrary/v1 api를 활용해 주세요. (주의: 응답 데이터 양식 일부 변경이 있어요!)
  • api 요청에 TanStack React Query를 활용해 주세요.
  • 로그인은 POST ‘/auth/sign-in’ 을 활용해 주세요.
  • 회원가입은 POST ‘/auth/sign-up’ 을
이메일 중복확인은 POST ‘/users/check-email’을
활용해 주세요
  • 폴더의 정보는 GET ‘/folders/{folderId}’,
폴더 소유자의 정보는 GET ‘/users/{userId}’를 활용해 주세요.
  • 링크 공유 페이지에서 폴더의 링크 데이터는 GET ‘/folders/{folderId}/links’를 활용해 주세요.
  • 유효한 access token이 있는 경우 GET ‘/users’로 현재 로그인한 유저 정보를 받아 상단 네비게이션 유저 프로필을 보여 주세요.
  • 유효한 access token이 없는 경우 “로그인” 버튼을 보여 주세요.
  • 폴더 페이지에서 현재 유저의 폴더 목록 데이터는 GET ‘/folders’를 활용해 주세요.
  • 폴더 페이지에서 전체 링크 데이터를 받아올 때 GET ‘/links’, 특정 폴더의 링크를 받아올 때 GET ‘/folders/{folderId}/links’를 활용해 주세요.
  • 폴더 이름 변경은 ‘PUT /folders/{folderId}’를 활용해 주세요.
  • 폴더 생성은 ‘POST /folders’를 활용해 주세요.
  • 폴더 삭제는 ‘DELETE /folders/{folderId}’를 활용해 주세요.
  • 링크 삭제는 ‘DELETE /links/{linkId}’를 활용해 주세요.
  • 링크 생성은 ‘POST /links’를 활용해 주세요.

심화

없음

멘토에게

  • api request를 보내고 response를 받아오는 부분을 모두 react-query로 바꾸었습니다.

@vercel
Copy link

vercel bot commented May 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
4-weekly-mission ❌ Failed (Inspect) May 9, 2024 3:38am
4-weekly-mission-ursd ❌ Failed (Inspect) May 9, 2024 3:38am

@kimtaejin3 kimtaejin3 self-assigned this May 9, 2024
@kimtaejin3 kimtaejin3 added the 매운맛🔥 뒤는 없습니다. 그냥 필터 없이 말해주세요. 책임은 제가 집니다. label May 9, 2024
<div>로딩중입니다...</div>
) : folderListError ? (
<div>폴더 정보들을 가져오는데 실패했습니다.</div>
) : (
Copy link
Collaborator Author

@kimtaejin3 kimtaejin3 May 13, 2024

Choose a reason for hiding this comment

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

로딩, 에러 처리를 일단 위 같은 식으로 삼항연산자를 중첩해서 사용했는데 어떻게 개선하면 좋을까요?

Copy link
Collaborator

Choose a reason for hiding this comment

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

지금도 괜찮다고 생각하지만, 아래처럼 하는것도 괜찮을거같아요. status로, 같은 상태를 기준으로 하면서 &&로 짧은 표현으로요

Suggested change
) : (
{status === 'loading' && <div>로딩중입니다...</div>}
{status === 'error' &&
<div>폴더 정보들을 가져오는데 실패했습니다.</div>}

@kimtaejin3 kimtaejin3 requested a review from domuk-k May 13, 2024 13:44
export const instance = axios.create({
baseURL: "https://bootcamp-api.codeit.kr/api",
timeout: 1000,
baseURL: " https://bootcamp-api.codeit.kr/api/linkbrary/v1",
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

password: string;
}) {
const response = await fetch(`${BASE_URL}/sign-in`, {
const response = await fetch(`${BASE_URL}/auth/sign-in`, {
Copy link
Collaborator

Choose a reason for hiding this comment

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

http client로 axios를 사용한다면, 특별한 경우를 제외하고는 통일하시는게 일반적으로 좋습니다

<div>로딩중입니다...</div>
) : folderListError ? (
<div>폴더 정보들을 가져오는데 실패했습니다.</div>
) : (
Copy link
Collaborator

Choose a reason for hiding this comment

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

지금도 괜찮다고 생각하지만, 아래처럼 하는것도 괜찮을거같아요. status로, 같은 상태를 기준으로 하면서 &&로 짧은 표현으로요

Suggested change
) : (
{status === 'loading' && <div>로딩중입니다...</div>}
{status === 'error' &&
<div>폴더 정보들을 가져오는데 실패했습니다.</div>}

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.

2 participants