From 0d19a12d3c3ebf0e1abb6706e7bc76758ee09ad3 Mon Sep 17 00:00:00 2001 From: DebugIsFalse <511418503@qq.com> Date: Wed, 29 May 2024 10:33:10 +0800 Subject: [PATCH] fix: error --- components/i/Create.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/i/Create.vue b/components/i/Create.vue index 338416d..7d7f61f 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(() => { -- GitLab