Add nullable region field to evolutions for regional form filtering
Regional evolutions (e.g., Pikachu → Alolan Raichu) only occur in specific regions. This adds a nullable region column so the app can filter evolutions by the game's region. When a regional evolution exists for a given trigger/item, the non-regional counterpart is automatically hidden. Full-stack: migration, model, schemas, API with region query param, seeder, Go fetch tool, frontend types/API/hook/components, and admin form. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -29,6 +29,7 @@ export function EvolutionFormModal({
|
||||
const [item, setItem] = useState(evolution?.item ?? '')
|
||||
const [heldItem, setHeldItem] = useState(evolution?.heldItem ?? '')
|
||||
const [condition, setCondition] = useState(evolution?.condition ?? '')
|
||||
const [region, setRegion] = useState(evolution?.region ?? '')
|
||||
|
||||
const handleSubmit = (e: FormEvent) => {
|
||||
e.preventDefault()
|
||||
@@ -41,6 +42,7 @@ export function EvolutionFormModal({
|
||||
item: item || null,
|
||||
heldItem: heldItem || null,
|
||||
condition: condition || null,
|
||||
region: region || null,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -119,6 +121,16 @@ export function EvolutionFormModal({
|
||||
className="w-full px-3 py-2 border rounded-md dark:bg-gray-700 dark:border-gray-600"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label className="block text-sm font-medium mb-1">Region</label>
|
||||
<input
|
||||
type="text"
|
||||
value={region}
|
||||
onChange={(e) => setRegion(e.target.value)}
|
||||
placeholder="e.g. alola (blank = all regions)"
|
||||
className="w-full px-3 py-2 border rounded-md dark:bg-gray-700 dark:border-gray-600"
|
||||
/>
|
||||
</div>
|
||||
</FormModal>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user