mirror of
https://github.com/YFGaia/dify-plus.git
synced 2026-06-14 20:41:21 +08:00
9b128048c4
Co-authored-by: CodingOnStar <hanxujiang@dify.ai>
19 lines
514 B
TypeScript
19 lines
514 B
TypeScript
import { useMutation } from '@tanstack/react-query'
|
|
import { checkIsUsedInApp, deleteDataset } from './datasets'
|
|
|
|
const NAME_SPACE = 'dataset-card'
|
|
|
|
export const useCheckDatasetUsage = () => {
|
|
return useMutation({
|
|
mutationKey: [NAME_SPACE, 'check-usage'],
|
|
mutationFn: (datasetId: string) => checkIsUsedInApp(datasetId),
|
|
})
|
|
}
|
|
|
|
export const useDeleteDataset = () => {
|
|
return useMutation({
|
|
mutationKey: [NAME_SPACE, 'delete'],
|
|
mutationFn: (datasetId: string) => deleteDataset(datasetId),
|
|
})
|
|
}
|