Skip to content

Commit e57628c

Browse files
committed
✨ 🏷️ return data as User
1 parent 09ce1b3 commit e57628c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/modules/User/services/userBase.ts

+12-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,19 @@ interface UserAsyncProps {
66
id: number;
77
}
88

9+
interface User {
10+
id: number;
11+
name: string;
12+
email: string;
13+
}
14+
15+
export async function getUserListAsync() {
16+
const response = await handlerApiAsync<User>({ execute: () => api.get(`${userBase()}`) });
17+
return response;
18+
}
19+
920
export async function getUserAsync({ id }: UserAsyncProps) {
10-
const response = await handlerApiAsync({ execute: () => api.get(`${userBase()}/${id}`) });
21+
const response = await handlerApiAsync<User>({ execute: () => api.get(`${userBase()}/${id}`) });
1122
return response;
1223
}
1324

0 commit comments

Comments
 (0)