mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 01:48:04 +08:00
fix: add dataset reset functionality and improve warning message consistency
This commit is contained in:
@ -11,6 +11,7 @@ import Button from '@/app/components/base/button'
|
||||
|
||||
import { ToastContext } from '@/app/components/base/toast'
|
||||
import { createEmptyDataset } from '@/service/datasets'
|
||||
import { useResetDatasetList } from '@/service/knowledge/use-dataset'
|
||||
|
||||
type IProps = {
|
||||
show: boolean
|
||||
@ -25,6 +26,7 @@ const EmptyDatasetCreationModal = ({
|
||||
const { t } = useTranslation()
|
||||
const { notify } = useContext(ToastContext)
|
||||
const router = useRouter()
|
||||
const resetDatasetList = useResetDatasetList()
|
||||
|
||||
const submit = async () => {
|
||||
if (!inputValue) {
|
||||
@ -37,6 +39,7 @@ const EmptyDatasetCreationModal = ({
|
||||
}
|
||||
try {
|
||||
const dataset = await createEmptyDataset({ name: inputValue })
|
||||
resetDatasetList()
|
||||
onHide()
|
||||
router.push(`/datasets/${dataset.id}/documents`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user