Skip to content

Commit

Permalink
Merge pull request #234 from wusung/feature/fix-empty-urls
Browse files Browse the repository at this point in the history
fix: failed to update knowledgebases when urls is empty
  • Loading branch information
sugarforever authored Apr 8, 2024
2 parents 910ba29 + e9eb408 commit 0e45dd5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions components/KnowledgeBaseUpdateForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0e45dd5

Please sign in to comment.