Skip to content

Commit 1a03a39

Browse files
committed
ADD : queryKey constants 파일로 관리
1 parent 2853658 commit 1a03a39

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

components/Aside/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import httpClient from '@/lib/httpClient'
88
import Docs from '@/types/docs.type'
99
import { useQuery } from 'react-query'
1010
import { getAccessToken } from '@/lib/httpClient/getAccessToken'
11+
import queryKey from '@/constants/queryKey.constants'
1112

1213
const Aside = () => {
1314
const [page, setPage] = React.useState(0)
@@ -17,7 +18,7 @@ const Aside = () => {
1718
return (await httpClient.lastModified.getInQuery('page', page)).data
1819
}
1920

20-
const { refetch } = useQuery('getLastModifiedDocs', onGetLastModifiedDocs, {
21+
const { refetch } = useQuery([queryKey.getLastModify], onGetLastModifiedDocs, {
2122
onSuccess: (data) => {
2223
setLastModifiedDocs(data)
2324
},

constants/queryKey.constants.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const queryKey = {
2+
getLastModify: 'getLastModify',
3+
}
4+
5+
export default queryKey

0 commit comments

Comments
 (0)