feat(pokemon): add image selection and display from pokesprite

Add image metadata fields to Pokemon schema and API
Implement image candidate fetching from pokesprite static tree
Add Pokédex-style image picker to edit form and display in details
This commit is contained in:
2026-05-02 20:59:33 +08:00
parent 475e3577dd
commit cf0ae566c0
13 changed files with 749 additions and 20 deletions

View File

@@ -29,6 +29,7 @@ import {
deletePokemon,
deleteRecipe,
fetchPokemonData,
fetchPokemonImageOptions,
getHabitat,
getItem,
getOptions,
@@ -372,6 +373,11 @@ app.post('/api/pokemon/fetch', async (request, reply) => {
return user ? fetchPokemonData(request.body as Record<string, unknown>, user.id) : undefined;
});
app.post('/api/pokemon/image-options', async (request, reply) => {
const user = await requireVerifiedUser(request, reply);
return user ? fetchPokemonImageOptions(request.body as Record<string, unknown>) : undefined;
});
app.put('/api/pokemon/:id', async (request, reply) => {
const user = await requireVerifiedUser(request, reply);
if (!user) {