From 09e08f44d03b73fef6176deb7e1636a8b7e637f4 Mon Sep 17 00:00:00 2001 From: limes Date: Mon, 17 Aug 2026 23:25:17 +0200 Subject: [PATCH] feat: add birthday field to register page --- server/api/auth/register.post.ts | 4 +++- shared/api-types.ts | 1 + src/pages/account/register.vue | 13 ++++++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/server/api/auth/register.post.ts b/server/api/auth/register.post.ts index 0575309..89e22d9 100644 --- a/server/api/auth/register.post.ts +++ b/server/api/auth/register.post.ts @@ -5,6 +5,8 @@ export default defineEventHandler(async (event): Promise => { 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 => { captchaResponse: body.captchaResponse, username: body.username, password: body.password, - passwordConfirm: body.password + passwordConfirm: body.password, }); return { diff --git a/shared/api-types.ts b/shared/api-types.ts index 293cc8f..f7dd122 100644 --- a/shared/api-types.ts +++ b/shared/api-types.ts @@ -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; diff --git a/src/pages/account/register.vue b/src/pages/account/register.vue index d66c000..0a196a9 100644 --- a/src/pages/account/register.vue +++ b/src/pages/account/register.vue @@ -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 > +
+ + +