chore: update error message handler

This commit is contained in:
Steven 2023-06-25 23:01:13 +08:00
parent 96e858f08c
commit b0b8d746c8
5 changed files with 7 additions and 7 deletions

View File

@ -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();
}; };

View File

@ -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);
} }
}; };

View File

@ -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();
}; };

View File

@ -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

View File

@ -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();
}; };