From c6f2befbf6930e83b5d8edaeeebbadadc973f328 Mon Sep 17 00:00:00 2001 From: Application-drop-up Date: Tue, 28 Jul 2026 09:24:19 +0900 Subject: [PATCH 1/2] feat(user): require age_range when creating a user (#466) --- client/src/app/features/user/apis/user-api.ts | 1 + .../features/user/components/UserCreateForm.tsx | 17 +++++++++++++++++ .../user/mapper/to-create-user-request.ts | 1 + .../src/app/features/user/mapper/user.types.ts | 1 + client/src/app/features/user/types.ts | 1 + 5 files changed, 21 insertions(+) diff --git a/client/src/app/features/user/apis/user-api.ts b/client/src/app/features/user/apis/user-api.ts index 047080b..50fe142 100644 --- a/client/src/app/features/user/apis/user-api.ts +++ b/client/src/app/features/user/apis/user-api.ts @@ -10,6 +10,7 @@ export type CreateUserRequest = { last_name: string; email: string; password: string; + age_range: AgeRange; }; export type UpdateUserRequest = { diff --git a/client/src/app/features/user/components/UserCreateForm.tsx b/client/src/app/features/user/components/UserCreateForm.tsx index ecf53c7..1a52c90 100644 --- a/client/src/app/features/user/components/UserCreateForm.tsx +++ b/client/src/app/features/user/components/UserCreateForm.tsx @@ -1,8 +1,10 @@ import type { FormEvent } from "react"; +import MenuItem from "@mui/material/MenuItem"; import TextField from "@shared/uis/TextField.tsx"; import { Button } from "@shared/uis/Button.tsx"; import { ErrorPanel } from "@shared/uis/ErrorPanel.tsx"; import { useText } from "@shared/locale/ui-text.ts"; +import { AGE_RANGES } from "../types"; import type { CreateUserFormValues } from "../types"; import type { ApiUserDto } from "../apis/user-api"; @@ -75,6 +77,21 @@ export function UserCreateForm({ onChange={(e) => handleField("password", e.target.value)} required /> + + handleField("ageRange", e.target.value as CreateUserFormValues["ageRange"]) + } + required + > + {AGE_RANGES.map((ageRange) => ( + + {ageRange} + + ))} +