async function fetchTemplates() {
let seturl = `https://wax.api.atomicassets.io/atomicassets/v1/templates?collection_name=mlb.topps&schema_name=series1}&has_assets=true&page=1&limit=3414&order=desc&sort=created`;
try {
let res = await fetch(seturl);
return await res.json();
} catch (error) {
console.log(error);
}
}
async function renderFilterVariants(arg) {
let sets = await fetchTemplates();
console.log(sets);
if( !Array.isArray( sets.data ) )
{
throw new Error( "atts.data is not an array." );
}
const team = sets.data.map( d => d.immutable_data.${arg});
console.log(team);
}
renderFilterVariants(cardid);
Why doesn't this work? I want the function to be able to pass a custom variation under d.immutable_data
It has to be dynamic as the variations under immutable_data is different depending on page.

