Skip to content

Conversation

@jeewonMoon
Copy link
Member

@jeewonMoon jeewonMoon commented Jul 29, 2024

Issue

Details

  • axios를 설치했습니다.
  • axios 인스턴스를 생성했습니다.
  • authAPI는 로그인 구현과 함께 수정하겠습니다.
  • 사용 예시
import {getCourseList} from '@/apis/api/course';

const getList = async (body: object) => {
      await getCourseList(body).then(res => {
        console.log(res);
    });
 };
  • 참고 하시면 좋을 것 같습니다!

- axios를 설치했습니다.
- axios 인스턴스를 생성했습니다.
- authAPI는 로그인 구현과 함께 수정하겠습니다.
@jeewonMoon jeewonMoon requested a review from stableh July 29, 2024 11:22
@jeewonMoon jeewonMoon self-assigned this Jul 29, 2024
@jeewonMoon jeewonMoon linked an issue Jul 29, 2024 that may be closed by this pull request
Copy link
Member

@stableh stableh left a comment

Choose a reason for hiding this comment

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

고생하셨습니다..!!

Comment on lines +3 to +10
export const getCourseList = async (body: object) => {
try {
const {data} = await baseAPI.get('/schedules/search', body);
return data;
} catch (error) {
console.log('get course list fail: ', error);
}
};
Copy link
Member

Choose a reason for hiding this comment

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

전 지금까지 컴포넌트 안에서 처리하고 있었는데, 이렇게 모듈화 하면 관리하기 편하겠네요!

@stableh stableh merged commit 2bd3e93 into develop Jul 29, 2024
@jeewonMoon jeewonMoon deleted the feat/21-axios-setting branch July 29, 2024 12:03
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.

feat: API 모듈화

3 participants