From 43551a99345cc8f49d8419dc437daa92185a1648 Mon Sep 17 00:00:00 2001 From: KANGYONGSU23 Date: Wed, 15 Nov 2023 22:40:31 +0900 Subject: [PATCH] =?UTF-8?q?feat=20::=20=EB=B6=81=EB=A7=88=ED=81=AC=20api?= =?UTF-8?q?=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/bookmarks/index.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/apis/bookmarks/index.ts diff --git a/src/apis/bookmarks/index.ts b/src/apis/bookmarks/index.ts new file mode 100644 index 0000000..ee40491 --- /dev/null +++ b/src/apis/bookmarks/index.ts @@ -0,0 +1,17 @@ +import { useMutation, useQuery } from "@tanstack/react-query"; +import { instance } from "../axios"; + +const router = "/bookmarks"; + +export const GetBookmarks = () => { + return useQuery(["GetBookmarks"], async () => { + const { data } = await instance.get(`${router}`); + return data; + }); +}; + +export const SetBookmaeks = (recruitmentId: number) => { + return useMutation(["SetBookmarks", recruitmentId], async () => { + await instance.patch(`${router}/${recruitmentId}`); + }); +};