diff --git a/client/src/app/features/user/apis/index.test.ts b/client/src/app/features/user/apis/index.test.ts index e000c52..cdc847a 100644 --- a/client/src/app/features/user/apis/index.test.ts +++ b/client/src/app/features/user/apis/index.test.ts @@ -32,6 +32,7 @@ const makeRequest = (overrides: Partial = {}): CreateUserRequ last_name: "Yamada", email: "taro@example.com", password: "password123", + age_range: "teens", ...overrides, }); 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} + + ))} +