Skip to content

Commit 112eb56

Browse files
committed
refactor: api 분리
1 parent 4cede5f commit 112eb56

File tree

2 files changed

+21
-18
lines changed

2 files changed

+21
-18
lines changed

src/apis/signup.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { axiosInstance } from '@/apis/axios';
2+
3+
interface SignUpPayload {
4+
nickName: string;
5+
loginId: string;
6+
password: string;
7+
email: string;
8+
}
9+
10+
// 회원가입
11+
export const postSignUp = async ({ nickName, loginId, password, email }: SignUpPayload) => {
12+
const { data } = await axiosInstance.post('/user/signup', {
13+
nickName,
14+
socialId: null,
15+
socialType: 'NONE',
16+
loginId,
17+
password,
18+
email,
19+
});
20+
return data;
21+
};

src/apis/user.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,6 @@ export const checkPassword = async (currentPassword: string) => {
3535
return data;
3636
};
3737

38-
// 회원가입
39-
export const postSignUp = async (
40-
nickName: string,
41-
loginId: string,
42-
password: string,
43-
email: string,
44-
) => {
45-
const { data } = await axiosInstance.post('/user/signup', {
46-
nickName,
47-
socialId: null,
48-
socialType: 'NONE',
49-
loginId,
50-
password,
51-
email,
52-
});
53-
return data;
54-
};
55-
5638
// 마이페이지 정보 불러오기
5739
export const getMyProfile = async () => {
5840
const { data } = await axiosInstance.get('/user/mypage');

0 commit comments

Comments
 (0)