-
Notifications
You must be signed in to change notification settings - Fork 117
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 #1068
base: part3-김태진
Are you sure you want to change the base?
The head ref may contain hidden characters: "part3-\uAE40\uD0DC\uC9C4"
[김태진] week20 #1068
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
<div>로딩중입니다...</div> | ||
) : folderListError ? ( | ||
<div>폴더 정보들을 가져오는데 실패했습니다.</div> | ||
) : ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
로딩, 에러 처리를 일단 위 같은 식으로 삼항연산자를 중첩해서 사용했는데 어떻게 개선하면 좋을까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
지금도 괜찮다고 생각하지만, 아래처럼 하는것도 괜찮을거같아요. status로, 같은 상태를 기준으로 하면서 &&로 짧은 표현으로요
) : ( | |
{status === 'loading' && <div>로딩중입니다...</div>} | |
{status === 'error' && | |
<div>폴더 정보들을 가져오는데 실패했습니다.</div>} |
@@ -2,8 +2,7 @@ import { getCookie } from "@/utils/cookie"; | |||
import axios from "axios"; | |||
|
|||
export const instance = axios.create({ | |||
baseURL: "https://bootcamp-api.codeit.kr/api", | |||
timeout: 1000, | |||
baseURL: " https://bootcamp-api.codeit.kr/api/linkbrary/v1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -7,7 +7,7 @@ export async function postUserSignin({ | |||
email: string; | |||
password: string; | |||
}) { | |||
const response = await fetch(`${BASE_URL}/sign-in`, { | |||
const response = await fetch(`${BASE_URL}/auth/sign-in`, { |
There was a problem hiding this comment.
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> | ||
) : ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
지금도 괜찮다고 생각하지만, 아래처럼 하는것도 괜찮을거같아요. status로, 같은 상태를 기준으로 하면서 &&로 짧은 표현으로요
) : ( | |
{status === 'loading' && <div>로딩중입니다...</div>} | |
{status === 'error' && | |
<div>폴더 정보들을 가져오는데 실패했습니다.</div>} |
요구사항
기본
심화
없음
멘토에게