mirror of
https://github.com/PretendoNetwork/website.git
synced 2026-08-24 01:26:57 -05:00
feat: add birthday field to register page
This commit is contained in:
@@ -5,6 +5,8 @@ export default defineEventHandler(async (event): Promise<ApiAuthLogin> => {
|
||||
const body = await readZodBody(event, RegisterSchema);
|
||||
const grpc = useApiGrpc(event);
|
||||
|
||||
console.log(body.birthday);
|
||||
|
||||
// eslint-disable-next-line no-useless-catch -- Temp before error handling is implemented
|
||||
try {
|
||||
// TODO Add ip
|
||||
@@ -15,7 +17,7 @@ export default defineEventHandler(async (event): Promise<ApiAuthLogin> => {
|
||||
captchaResponse: body.captchaResponse,
|
||||
username: body.username,
|
||||
password: body.password,
|
||||
passwordConfirm: body.password
|
||||
passwordConfirm: body.password,
|
||||
});
|
||||
|
||||
return {
|
||||
|
||||
@@ -100,6 +100,7 @@ export const RegisterSchema = z.object({
|
||||
username: z.string(),
|
||||
miiName: z.string(),
|
||||
password: z.string(),
|
||||
birthday: z.string(),
|
||||
captchaResponse: z.string().optional()
|
||||
});
|
||||
export type ApiAuthRegisterRequest = z.infer<typeof RegisterSchema>;
|
||||
|
||||
@@ -16,7 +16,7 @@ const loginURI = computed(() => {
|
||||
return `/account/login`;
|
||||
});
|
||||
|
||||
const registerForm = reactive({ email: '', username: '', mii_name: '', password: '', password_confirm: '' });
|
||||
const registerForm = reactive({ email: '', username: '', mii_name: '', birthday: '', password: '', password_confirm: '' });
|
||||
const captchaRef = useTemplateRef('captcha');
|
||||
|
||||
const { execute, isLoading } = useAsync({
|
||||
@@ -36,6 +36,7 @@ const { execute, isLoading } = useAsync({
|
||||
miiName: registerForm.mii_name,
|
||||
password: registerForm.password,
|
||||
username: registerForm.username,
|
||||
birthday: registerForm.birthday,
|
||||
captchaResponse: captchaResponse ?? undefined
|
||||
} satisfies ApiAuthRegisterRequest
|
||||
});
|
||||
@@ -95,6 +96,16 @@ const { execute, isLoading } = useAsync({
|
||||
required
|
||||
>
|
||||
</div>
|
||||
<div>
|
||||
<label for="mii_name">{{ $t("account.loginForm.birthdate") }}</label>
|
||||
<input
|
||||
id="birthday"
|
||||
v-model="registerForm.birthday"
|
||||
name="birthday"
|
||||
type="date"
|
||||
required
|
||||
>
|
||||
</div>
|
||||
<div>
|
||||
<label for="password">{{ $t("account.loginForm.password") }}</label>
|
||||
<input
|
||||
|
||||
Reference in New Issue
Block a user