From 46de5b7002e85e6f208da6673b452aa70498fb15 Mon Sep 17 00:00:00 2001 From: LSJ Date: Mon, 16 Sep 2024 16:30:32 +0900 Subject: [PATCH] wip --- constants/keys/queryKeys.ts | 1 + hooks/admin/quries.ts | 14 ++++++++++++++ pages/admin/index.tsx | 3 ++- pages/admin/response/locationActive.tsx | 11 +++++++++++ 4 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 pages/admin/response/locationActive.tsx diff --git a/constants/keys/queryKeys.ts b/constants/keys/queryKeys.ts index 59b741324..0679841fb 100644 --- a/constants/keys/queryKeys.ts +++ b/constants/keys/queryKeys.ts @@ -42,5 +42,6 @@ export const STORE_GIFT = "storeGift"; export const COLLECTION_ALPHABET = "collectionAlphabet"; export const ADMIN_STUDY_RECORD = "adminStudyRecord"; +export const ADMIN_LOCATION_ACTIVE = "adminLocationActive"; export const STUDY_PREFERENCE_LOCAL = "studyPreferenceLocal4"; diff --git a/hooks/admin/quries.ts b/hooks/admin/quries.ts index 9e8b11953..3bc9d7f10 100644 --- a/hooks/admin/quries.ts +++ b/hooks/admin/quries.ts @@ -106,3 +106,17 @@ export const usePushQuery = (uid: string, options?: QueryOptions) => }, options, ); + +export const useAdminLocationActiveQuery = (month: number, options?: QueryOptions) => + useQuery( + [ADMIN_STUDY_RECORD, month], + async () => { + const res = await axios.get(`${SERVER_URI}/static/sameLoc`, { + params: { + date: "2024-09-01", + }, + }); + return res.data; + }, + options, + ); diff --git a/pages/admin/index.tsx b/pages/admin/index.tsx index b7e21dad0..2396b3358 100644 --- a/pages/admin/index.tsx +++ b/pages/admin/index.tsx @@ -1,6 +1,6 @@ import axios from "axios"; -import { useRouter } from "next/router"; import { useSession } from "next-auth/react"; +import { useRouter } from "next/router"; import styled from "styled-components"; import Header from "../../components/layouts/Header"; @@ -46,6 +46,7 @@ function Admin() { 유저 응답 + diff --git a/pages/admin/response/locationActive.tsx b/pages/admin/response/locationActive.tsx new file mode 100644 index 000000000..0a41035e4 --- /dev/null +++ b/pages/admin/response/locationActive.tsx @@ -0,0 +1,11 @@ +import { useAdminLocationActiveQuery } from "../../../hooks/admin/quries"; + +interface LocationActiveProps {} + +function LocationActive({}: LocationActiveProps) { + const { data } = useAdminLocationActiveQuery(2); + console.log(data); + return <>2; +} + +export default LocationActive;