diff options
author | crupest <crupest@outlook.com> | 2023-08-26 23:49:28 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2023-08-26 23:49:28 +0800 |
commit | 256cc9592a3f31fc392e1ccdb699aa206b7b47ce (patch) | |
tree | fdca6f8b1cdbd5ed264a1af9e48496685f4e9a95 /FrontEnd/src/pages/register | |
parent | f5dfd52f6efece2f4cad227044ecf4dd66301bbc (diff) | |
download | timeline-256cc9592a3f31fc392e1ccdb699aa206b7b47ce.tar.gz timeline-256cc9592a3f31fc392e1ccdb699aa206b7b47ce.tar.bz2 timeline-256cc9592a3f31fc392e1ccdb699aa206b7b47ce.zip |
...
Diffstat (limited to 'FrontEnd/src/pages/register')
-rw-r--r-- | FrontEnd/src/pages/register/index.tsx | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/FrontEnd/src/pages/register/index.tsx b/FrontEnd/src/pages/register/index.tsx index 9e478612..fa25c2c2 100644 --- a/FrontEnd/src/pages/register/index.tsx +++ b/FrontEnd/src/pages/register/index.tsx @@ -7,11 +7,7 @@ import { getHttpTokenClient } from "~src/http/token"; import { userService, useUser } from "~src/services/user"; import { LoadingButton } from "~src/components/button"; -import { - useInputs, - InputErrorDict, - InputGroup, -} from "~src/components/input/InputGroup"; +import { useInputs, InputGroup } from "~src/components/input/InputGroup"; import "./index.css"; @@ -51,26 +47,22 @@ export default function RegisterPage() { label: "register.registerCode", }, ], - validator: ({ - username, - password, - confirmPassword, - registerCode, - }) => { - const result: InputErrorDict = {}; + validator: ( + { username, password, confirmPassword, registerCode }, + errors, + ) => { if (username === "") { - result["username"] = "register.error.usernameEmpty"; + errors["username"] = "register.error.usernameEmpty"; } if (password === "") { - result["password"] = "register.error.passwordEmpty"; + errors["password"] = "register.error.passwordEmpty"; } if (confirmPassword !== password) { - result["confirmPassword"] = "register.error.confirmPasswordWrong"; + errors["confirmPassword"] = "register.error.confirmPasswordWrong"; } if (registerCode === "") { - result["registerCode"] = "register.error.registerCodeEmpty"; + errors["registerCode"] = "register.error.registerCodeEmpty"; } - return result; }, }, dataInit: {}, |