diff --git a/src/components/AppBar.vue b/src/components/AppBar.vue index 4d806d2..dd46187 100644 --- a/src/components/AppBar.vue +++ b/src/components/AppBar.vue @@ -19,21 +19,21 @@ + + @@ -62,9 +71,12 @@ import { useConfigStore } from "@/stores/config"; import { useUserStore } from "@/stores/user"; import { useAppStore } from "@/stores/app"; +import { useChatStore } from "@/stores/chat"; +const chatStore = useChatStore(); const configStore = useConfigStore(); const userStore = useUserStore(); - const appStore = useAppStore(); + +chatStore.getChats(); diff --git a/src/pages/chats/[id]/index.vue b/src/pages/chats/[id]/index.vue new file mode 100644 index 0000000..11609bd --- /dev/null +++ b/src/pages/chats/[id]/index.vue @@ -0,0 +1,3 @@ + diff --git a/src/pages/chats/index.vue b/src/pages/chats/index.vue new file mode 100644 index 0000000..e69de29 diff --git a/src/stores/chat.ts b/src/stores/chat.ts new file mode 100644 index 0000000..c0c036f --- /dev/null +++ b/src/stores/chat.ts @@ -0,0 +1,16 @@ +import { ApiV1ChatsGet200Response } from "@/api"; +import { defineStore } from "pinia"; +import { api } from "@/plugins/api"; + +export const useChatStore = defineStore("chats", { + state: () => ({ + chats: [] as ApiV1ChatsGet200Response, + }), + actions: { + getChats() { + api.Chat.apiV1ChatsGet().then((response) => { + this.chats = response.data; + }); + }, + }, +}); diff --git a/src/typed-router.d.ts b/src/typed-router.d.ts index fc6064e..3d30964 100644 --- a/src/typed-router.d.ts +++ b/src/typed-router.d.ts @@ -25,6 +25,8 @@ declare module 'vue-router/auto-routes' { '/assistants/create': RouteRecordInfo<'/assistants/create', '/assistants/create', Record, Record>, '/auth/callback': RouteRecordInfo<'/auth/callback', '/auth/callback', Record, Record>, '/auth/login': RouteRecordInfo<'/auth/login', '/auth/login', Record, Record>, + '/chats/': RouteRecordInfo<'/chats/', '/chats', Record, Record>, + '/chats/[id]/': RouteRecordInfo<'/chats/[id]/', '/chats/:id', { id: ParamValue }, { id: ParamValue }>, '/ping/': RouteRecordInfo<'/ping/', '/ping', Record, Record>, '/tools/': RouteRecordInfo<'/tools/', '/tools', Record, Record>, '/tools/create': RouteRecordInfo<'/tools/create', '/tools/create', Record, Record>,