Skip to content

Conversation

@leedyun
Copy link

@leedyun leedyun commented Aug 4, 2024

6주차 과제 제출합니다..

},
});

instance.interceptors.request.use((config) => {
Copy link

Choose a reason for hiding this comment

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

interceptor 선언을 해당 훅에 선언한 이유가 있나요 ? 공통으로 적용되는 부분이기 때문에 api/index.ts 같은 곳에 선언하면 될 거 같아요.


export type GoodsDetailResponseData = ProductData;

export const getProductDetailPath = (productId: string) => `${BASE_URL}/api/products/${productId}`;
Copy link

Choose a reason for hiding this comment

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

baseUrl 을 axios instance 에 공통으로 선언하면 base url 을 한 곳에서만 선언하면 됩니다.

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