refac: toast error

This commit is contained in:
Timothy Jaeryang Baek
2025-01-20 22:41:32 -08:00
parent af48f346f1
commit a863f98c53
52 changed files with 123 additions and 123 deletions
+6 -6
View File
@@ -79,7 +79,7 @@
const initFolders = async () => {
const folderList = await getFolders(localStorage.token).catch((error) => {
toast.error(error);
toast.error(`${error}`);
return [];
});
@@ -144,7 +144,7 @@
};
const res = await createNewFolder(localStorage.token, name).catch((error) => {
toast.error(error);
toast.error(`${error}`);
return null;
});
@@ -433,7 +433,7 @@
name: name,
access_control: access_control
}).catch((error) => {
toast.error(error);
toast.error(`${error}`);
return null;
});
@@ -646,7 +646,7 @@
if (chat.folder_id) {
const res = await updateChatFolderIdById(localStorage.token, chat.id, null).catch(
(error) => {
toast.error(error);
toast.error(`${error}`);
return null;
}
);
@@ -665,7 +665,7 @@
const res = await updateFolderParentIdById(localStorage.token, id, null).catch(
(error) => {
toast.error(error);
toast.error(`${error}`);
return null;
}
);
@@ -711,7 +711,7 @@
chat.id,
null
).catch((error) => {
toast.error(error);
toast.error(`${error}`);
return null;
});
}
@@ -28,7 +28,7 @@
const unarchiveChatHandler = async (chatId) => {
const res = await archiveChatById(localStorage.token, chatId).catch((error) => {
toast.error(error);
toast.error(`${error}`);
});
chats = await getArchivedChatList(localStorage.token);
@@ -37,7 +37,7 @@
const deleteChatHandler = async (chatId) => {
const res = await deleteChatById(localStorage.token, chatId).catch((error) => {
toast.error(error);
toast.error(`${error}`);
});
chats = await getArchivedChatList(localStorage.token);
@@ -88,7 +88,7 @@
const cloneChatHandler = async (id) => {
const res = await cloneChatById(localStorage.token, id).catch((error) => {
toast.error(error);
toast.error(`${error}`);
return null;
});
@@ -103,7 +103,7 @@
const deleteChatHandler = async (id) => {
const res = await deleteChatById(localStorage.token, id).catch((error) => {
toast.error(error);
toast.error(`${error}`);
return null;
});
@@ -116,7 +116,7 @@
// Move the folder
const res = await updateFolderParentIdById(localStorage.token, id, folderId).catch(
(error) => {
toast.error(error);
toast.error(`${error}`);
return null;
}
);
@@ -137,7 +137,7 @@
// Move the chat
const res = await updateChatFolderIdById(localStorage.token, chat.id, folderId).catch(
(error) => {
toast.error(error);
toast.error(`${error}`);
return null;
}
);
@@ -233,7 +233,7 @@
const deleteHandler = async () => {
const res = await deleteFolderById(localStorage.token, folderId).catch((error) => {
toast.error(error);
toast.error(`${error}`);
return null;
});
@@ -260,7 +260,7 @@
folders[folderId].name = name;
const res = await updateFolderNameById(localStorage.token, folderId, name).catch((error) => {
toast.error(error);
toast.error(`${error}`);
folders[folderId].name = currentName;
return null;
@@ -276,7 +276,7 @@
const isExpandedUpdateHandler = async () => {
const res = await updateFolderIsExpandedById(localStorage.token, folderId, open).catch(
(error) => {
toast.error(error);
toast.error(`${error}`);
return null;
}
);
@@ -310,7 +310,7 @@
const exportHandler = async () => {
const chats = await getChatsByFolderId(localStorage.token, folderId).catch((error) => {
toast.error(error);
toast.error(`${error}`);
return null;
});
if (!chats) {