Skip to content

Commit 45edbaf

Browse files
committed
chore(services): home api 연결
1 parent 5a03647 commit 45edbaf

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import httpClient from "@/apis/httpClient";
2+
3+
export const getMain = async () => {
4+
const { data } = await httpClient.main.get();
5+
return data;
6+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { KEY } from "@/constants";
2+
import { useQuery } from "@tanstack/react-query";
3+
import { getMain } from "./api.service";
4+
5+
export const useMainQuery = () => {
6+
const { data, ...queryRest } = useQuery([KEY.MAIN], getMain);
7+
return { data, ...queryRest };
8+
};

0 commit comments

Comments
 (0)