ah oops, dont use syntax that prod doesn't support

right, dev supports `?.` syntax, but prod builds don't. I keep forgetting that!
This commit is contained in:
Emi Matchu 2020-09-15 03:27:41 -07:00
parent 2a30e8a6e5
commit 57c0981472

View file

@ -151,7 +151,8 @@ const resolvers = {
const speciesIdsByColorIdAndItemId = await itemsThatNeedModelsLoader.load( const speciesIdsByColorIdAndItemId = await itemsThatNeedModelsLoader.load(
"all" "all"
); );
const row = speciesIdsByColorIdAndItemId.get(colorId)?.get(id); const speciesIdsByItemId = speciesIdsByColorIdAndItemId.get(colorId);
const row = speciesIdsByItemId && speciesIdsByItemId.get(id);
if (!row) { if (!row) {
return []; return [];
} }
@ -232,7 +233,8 @@ const resolvers = {
const speciesIdsByColorIdAndItemId = await itemsThatNeedModelsLoader.load( const speciesIdsByColorIdAndItemId = await itemsThatNeedModelsLoader.load(
"all" "all"
); );
const itemIds = speciesIdsByColorIdAndItemId.get(colorId)?.keys() || []; const speciesIdsByItemIds = speciesIdsByColorIdAndItemId.get(colorId);
const itemIds = (speciesIdsByItemIds && speciesIdsByItemIds.keys()) || [];
return Array.from(itemIds, (id) => ({ id })); return Array.from(itemIds, (id) => ({ id }));
}, },
}, },