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
+2 -2
View File
@@ -74,7 +74,7 @@
const addGroupHandler = async (group) => {
const res = await createNewGroup(localStorage.token, group).catch((error) => {
toast.error(error);
toast.error(`${error}`);
return null;
});
@@ -89,7 +89,7 @@
const res = await updateUserDefaultPermissions(localStorage.token, group.permissions).catch(
(error) => {
toast.error(error);
toast.error(`${error}`);
return null;
}
);
@@ -23,7 +23,7 @@
const updateHandler = async (_group) => {
const res = await updateGroupById(localStorage.token, group.id, _group).catch((error) => {
toast.error(error);
toast.error(`${error}`);
return null;
});
@@ -35,7 +35,7 @@
const deleteHandler = async () => {
const res = await deleteGroupById(localStorage.token, group.id).catch((error) => {
toast.error(error);
toast.error(`${error}`);
return null;
});
@@ -44,7 +44,7 @@
const updateRoleHandler = async (id, role) => {
const res = await updateUserRole(localStorage.token, id, role).catch((error) => {
toast.error(error);
toast.error(`${error}`);
return null;
});
@@ -55,7 +55,7 @@
const deleteUserHandler = async (id) => {
const res = await deleteUserById(localStorage.token, id).catch((error) => {
toast.error(error);
toast.error(`${error}`);
return null;
});
if (res) {
@@ -49,7 +49,7 @@
_user.password,
_user.role
).catch((error) => {
toast.error(error);
toast.error(`${error}`);
});
if (res) {
@@ -24,7 +24,7 @@
const submitHandler = async () => {
const res = await updateUserById(localStorage.token, selectedUser.id, _user).catch((error) => {
toast.error(error);
toast.error(`${error}`);
});
if (res) {
@@ -20,7 +20,7 @@
const deleteChatHandler = async (chatId) => {
const res = await deleteChatById(localStorage.token, chatId).catch((error) => {
toast.error(error);
toast.error(`${error}`);
});
chats = await getChatListByUserId(localStorage.token, user.id);