mirror of
https://github.com/aykhans/slash-e.git
synced 2025-04-18 21:19:44 +00:00
chore: update error message handler
This commit is contained in:
parent
96e858f08c
commit
b0b8d746c8
@ -52,7 +52,7 @@ const ChangePasswordDialog: React.FC<Props> = (props: Props) => {
|
|||||||
toast("Password changed");
|
toast("Password changed");
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
toast.error(JSON.stringify(error.response.data));
|
toast.error(error.response.data.message);
|
||||||
}
|
}
|
||||||
requestState.setFinish();
|
requestState.setFinish();
|
||||||
};
|
};
|
||||||
|
@ -109,7 +109,7 @@ const CreateShortcutDialog: React.FC<Props> = (props: Props) => {
|
|||||||
}
|
}
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
toast.error(JSON.stringify(error.response.data));
|
toast.error(error.response.data.message);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ const EditUserinfoDialog: React.FC<Props> = (props: Props) => {
|
|||||||
toast("Password changed");
|
toast("Password changed");
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
toast.error(JSON.stringify(error.response.data));
|
toast.error(error.response.data.message);
|
||||||
}
|
}
|
||||||
requestState.setFinish();
|
requestState.setFinish();
|
||||||
};
|
};
|
||||||
|
@ -31,10 +31,10 @@ const Header: React.FC = () => {
|
|||||||
<button className="flex flex-row justify-end items-center cursor-pointer">
|
<button className="flex flex-row justify-end items-center cursor-pointer">
|
||||||
<Avatar size="sm" variant="plain" />
|
<Avatar size="sm" variant="plain" />
|
||||||
<span>{user.nickname}</span>
|
<span>{user.nickname}</span>
|
||||||
<Icon.ChevronDown className="ml-1 w-5 h-auto text-gray-600" />
|
<Icon.ChevronDown className="ml-2 w-5 h-auto text-gray-600" />
|
||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
actionsClassName="!w-36"
|
actionsClassName="!w-32"
|
||||||
actions={
|
actions={
|
||||||
<>
|
<>
|
||||||
<Link
|
<Link
|
||||||
|
@ -45,7 +45,7 @@ const Auth: React.FC = () => {
|
|||||||
}
|
}
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
toast.error(JSON.stringify(error.response.data));
|
toast.error(error.response.data.message);
|
||||||
}
|
}
|
||||||
actionBtnLoadingState.setFinish();
|
actionBtnLoadingState.setFinish();
|
||||||
};
|
};
|
||||||
@ -68,7 +68,7 @@ const Auth: React.FC = () => {
|
|||||||
}
|
}
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
toast.error(JSON.stringify(error.response.data));
|
toast.error(error.response.data.message);
|
||||||
}
|
}
|
||||||
actionBtnLoadingState.setFinish();
|
actionBtnLoadingState.setFinish();
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user