enh: restore tags from chat import

This commit is contained in:
Timothy J. Baek
2024-10-20 18:02:41 -07:00
parent 30eb43f5b8
commit d23252b8a9
4 changed files with 16 additions and 1 deletions

View File

@@ -35,6 +35,7 @@ export const createNewChat = async (token: string, chat: object) => {
export const importChat = async (
token: string,
chat: object,
meta: object | null,
pinned?: boolean,
folderId?: string | null
) => {
@@ -49,6 +50,7 @@ export const importChat = async (
},
body: JSON.stringify({
chat: chat,
meta: meta ?? {},
pinned: pinned,
folder_id: folderId
})

View File

@@ -211,8 +211,9 @@
const importChatHandler = async (items, pinned = false, folderId = null) => {
console.log('importChatHandler', items, pinned, folderId);
for (const item of items) {
console.log(item);
if (item.chat) {
await importChat(localStorage.token, item.chat, pinned, folderId);
await importChat(localStorage.token, item.chat, item?.meta ?? {}, pinned, folderId);
}
}