mirror of
https://github.com/langgenius/dify.git
synced 2026-01-14 06:07:33 +08:00
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),
|
|
})
|
|
}
|