fix(#64): Address PR feedback

This commit is contained in:
Josh Creek
2026-01-10 19:25:29 +00:00
parent 5657c2b2ab
commit 75f7161b7a
3 changed files with 31 additions and 5 deletions
+3 -2
View File
@@ -73,9 +73,10 @@ export const PUT = async (event: RequestEvent) => {
// Recalculate pokedex_entries_mapping if configuration changed
// Only recalculate if isFormDex or gameScope actually changed (these are the only fields that affect mapping)
// Compare the persisted result (pokedex) to existingPokedex to catch changes that repo.update may normalize or default
const configChanged =
(data.isFormDex !== undefined && existingPokedex.isFormDex !== data.isFormDex) ||
(data.gameScope !== undefined && existingPokedex.gameScope !== data.gameScope);
pokedex.isFormDex !== existingPokedex.isFormDex ||
pokedex.gameScope !== existingPokedex.gameScope;
if (configChanged) {
await recalculatePokedexMappings(event.locals.supabase, id, pokedex);