refac
This commit is contained in:
@@ -61,7 +61,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const importChatsHandler = async (_chats) => {
|
const importChatsHandler = async (_chats) => {
|
||||||
const chats = _chats.map((chat) => {
|
const res = await importChats(
|
||||||
|
localStorage.token,
|
||||||
|
_chats.map((chat) => {
|
||||||
if (chat.chat) {
|
if (chat.chat) {
|
||||||
return {
|
return {
|
||||||
chat: chat.chat,
|
chat: chat.chat,
|
||||||
@@ -82,9 +84,8 @@
|
|||||||
updated_at: chat?.updated_at ?? null
|
updated_at: chat?.updated_at ?? null
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
);
|
||||||
const res = await importChats(localStorage.token, chats);
|
|
||||||
if (res) {
|
if (res) {
|
||||||
toast.success(`Successfully imported ${res.length} chats.`);
|
toast.success(`Successfully imported ${res.length} chats.`);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user