diff --git a/components/i/Create.vue b/components/i/Create.vue index 338416d6c59c6d4c2510b0b59c79cc007a0d3cd0..7d7f61f5fd5f9e075a1ce2fa861d58a9ce0dc791 100644 --- a/components/i/Create.vue +++ b/components/i/Create.vue @@ -57,13 +57,14 @@ const handleSearch = async () => { loading.value = true const currentRepo = $repos.value.find(item => item.label === selectedRepo.value) const repo_path = currentRepo ? currentRepo.url : '' - const { data } = await useRequest('/v1/chat/completion/create', { + const { data, error } = await useRequest('/v1/chat/completion/create', { method: 'post', body: { repo_path, title: query.value } }) + if (error.value) return navigateTo(`/search/${data.value.data.c_id}`) emits('search') nextTick(() => {