diff --git a/api/user.ts b/api/user.ts index 7177370..8ec7ef5 100644 --- a/api/user.ts +++ b/api/user.ts @@ -22,3 +22,7 @@ export const getMySellInfo = async (isSaled: boolean) => { export const getMyInfo = async () => { return await userAPI.get(`/my/info?addressSplit=true`); }; + +export const getAlarm = async () => { + return await userAPI.get(`my/notifications`); +}; diff --git a/apiHooks/user.ts b/apiHooks/user.ts index 7b83774..69d6bb5 100644 --- a/apiHooks/user.ts +++ b/apiHooks/user.ts @@ -1,5 +1,5 @@ import { useQuery, useMutation } from '@tanstack/react-query'; -import { getmyBuy, getmyInfo, putmyInfo, getMySellInfo, getMyInfo } from 'api/user'; +import { getmyBuy, getmyInfo, putmyInfo, getMySellInfo, getMyInfo, getAlarm } from 'api/user'; import { MyInfoType } from 'types/recoil/myInfo'; export const useGetmyBuy = (isPurchased: boolean) => { @@ -41,3 +41,11 @@ export const useGetMyInfo = () => { }, }); }; + +export const useGetAlarm = () => { + return useQuery(['get/my/notifications'], () => getAlarm(), { + onError: (error) => { + console.log(error); + }, + }); +}; diff --git a/components/common/GNB.tsx b/components/common/GNB.tsx index 23858c3..2233665 100644 --- a/components/common/GNB.tsx +++ b/components/common/GNB.tsx @@ -21,7 +21,7 @@ export default function GNB({ currentGNB }: GNBProps) { return ( -