feat: knowledge used by app can still be removed (#5811)

This commit is contained in:
Joel
2024-07-01 16:14:49 +08:00
committed by GitHub
parent 0f8625cac2
commit 78d41a27cc
4 changed files with 26 additions and 6 deletions

View File

@@ -72,6 +72,12 @@ export const createEmptyDataset: Fetcher<DataSet, { name: string }> = ({ name })
return post<DataSet>('/datasets', { body: { name } })
}
export const checkIsUsedInApp: Fetcher<{ is_using: boolean }, string> = (id) => {
return get<{ is_using: boolean }>(`/datasets/${id}/use-check`, {}, {
silent: true,
})
}
export const deleteDataset: Fetcher<DataSet, string> = (datasetID) => {
return del<DataSet>(`/datasets/${datasetID}`)
}