mirror of
https://github.com/aykhans/slash-e.git
synced 2025-04-21 14:19:26 +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");
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
toast.error(JSON.stringify(error.response.data));
|
||||
toast.error(error.response.data.message);
|
||||
}
|
||||
requestState.setFinish();
|
||||
};
|
||||
|
@ -109,7 +109,7 @@ const CreateShortcutDialog: React.FC<Props> = (props: Props) => {
|
||||
}
|
||||
} catch (error: any) {
|
||||
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");
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
toast.error(JSON.stringify(error.response.data));
|
||||
toast.error(error.response.data.message);
|
||||
}
|
||||
requestState.setFinish();
|
||||
};
|
||||
|
@ -31,10 +31,10 @@ const Header: React.FC = () => {
|
||||
<button className="flex flex-row justify-end items-center cursor-pointer">
|
||||
<Avatar size="sm" variant="plain" />
|
||||
<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>
|
||||
}
|
||||
actionsClassName="!w-36"
|
||||
actionsClassName="!w-32"
|
||||
actions={
|
||||
<>
|
||||
<Link
|
||||
|
@ -45,7 +45,7 @@ const Auth: React.FC = () => {
|
||||
}
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
toast.error(JSON.stringify(error.response.data));
|
||||
toast.error(error.response.data.message);
|
||||
}
|
||||
actionBtnLoadingState.setFinish();
|
||||
};
|
||||
@ -68,7 +68,7 @@ const Auth: React.FC = () => {
|
||||
}
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
toast.error(JSON.stringify(error.response.data));
|
||||
toast.error(error.response.data.message);
|
||||
}
|
||||
actionBtnLoadingState.setFinish();
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user