Skip to content

Commit b88b49f

Browse files
committed
feat: 클라이언트 api 함수 매개변수에 인터페이스 명시
1 parent 5dbc7df commit b88b49f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

client/src/apis/auth.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { PostLoginParams } from 'params/auth';
2+
13
import { http } from './http';
24
import { OK, CREATED } from './http-status';
35

@@ -9,7 +11,7 @@ export const getAuth = async () => {
911
return res.data;
1012
};
1113

12-
export const postAuthLogin = async (code: string) => {
14+
export const postAuthLogin = async ({ code }: PostLoginParams) => {
1315
const res = await http.post(`/auth/login`, { code });
1416

1517
if (res.status !== CREATED) throw new Error();

client/src/apis/user.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
import { GetWorkspaceParams } from 'params/user';
2+
13
import { http } from './http';
24
import { OK } from './http-status';
35

4-
export const getWorkspaces = async (userId: number) => {
5-
const res = await http.get(`/user/${userId}/workspace`);
6+
export const getWorkspaces = async ({ id }: GetWorkspaceParams) => {
7+
const res = await http.get(`/user/${id}/workspace`);
68

79
if (res.status !== OK) throw new Error();
810

0 commit comments

Comments
 (0)