diff --git a/components/app/news/[provider]/[slug].vue b/components/app/news/[provider]/[slug].vue deleted file mode 100644 index c3995b0..0000000 --- a/components/app/news/[provider]/[slug].vue +++ /dev/null @@ -1,7 +0,0 @@ - - diff --git a/components/app/windows/chatbot.vue b/components/app/windows/chatbot.vue index 9c6e372..e3c545e 100644 --- a/components/app/windows/chatbot.vue +++ b/components/app/windows/chatbot.vue @@ -3,14 +3,27 @@ import { History, Plus, Send } from "lucide-vue-next"; import { Input } from "~/components/ui/input"; const { t } = useI18n(); const cookie = useCookie("lastChatId"); -const lastChatId = cookie.value; -const message = ref(); +const cookieChatId = cookie.value; +const chatId = ref(); +const inputMessage = ref(); const messages = ref([]); -onMounted(() => { - console.log(lastChatId); - if (lastChatId) { +onMounted(async () => { + console.log(cookieChatId); + if (cookieChatId) { + } else { + const { data: checkUserChatId } = await useFetch( + "/api/ai/chat/actions/findUserChatId", + ); + cookieChatId.value = checkUserChatId.value; } }); +onMounted(async () => { + const { + data: getData, + pending, + error, + } = useFetch(`/api/ai/chat/${chatId.value}`); +});