diff --git a/components/KnowledgeBaseUpdateForm.vue b/components/KnowledgeBaseUpdateForm.vue index f80327b..b1ff77d 100644 --- a/components/KnowledgeBaseUpdateForm.vue +++ b/components/KnowledgeBaseUpdateForm.vue @@ -22,10 +22,12 @@ const loading = ref(false) const onSubmit = async () => { loading.value = true const formData = new FormData() - state.urls - .split(' ') - .map((url: string) => url.trim()) - .forEach((url: string) => formData.append('urls', url)) + if (state.urls.trim().length > 0) { + state.urls + .split(' ') + .map((url: string) => url.trim()) + .forEach((url: string) => formData.append('urls', url)) + } Array.from(selectedFiles.value).forEach((file, index) => { console.log(`Index ${index}`, file)