Skip to content

Commit

Permalink
fix: 불필요한 코드 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
rabyeoljji committed Nov 22, 2024
1 parent 2c6c06b commit ce3bede
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions src/requests/document/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
import { useMutation } from '@tanstack/react-query'
import { useSession } from 'next-auth/react'
import { createDocument } from './create-document'
import { useQuery } from '@tanstack/react-query'
import { fetchDocumentDetail, fetchDocuments, updateDocument } from '.'
import { updateDocument } from '.'

export const useCreateDocument = () => {
const { data: session } = useSession()
Expand All @@ -23,18 +22,3 @@ export const useUpdateDocument = () => {
updateDocument(params.documentId, params.request, session?.user.accessToken || ''),
})
}

export const useGetDocuments = (params?: { directoryId?: string; sortOption?: Document.Sort }) => {
return useQuery({
queryKey: ['getDocuments', params?.directoryId, params?.sortOption],
queryFn: async () => fetchDocuments(params),
})
}

export const useGetDocumentDetail = (documentId: number) => {
return useQuery({
queryKey: ['getDocumentDetail', documentId],
queryFn: async () => fetchDocumentDetail(documentId),
enabled: !!documentId,
})
}

0 comments on commit ce3bede

Please sign in to comment.