Lockdown Struggles
Migrant Stories from the Lockdown
res.json()).then(res => {
sessionStorage.setItem('searchResults', JSON.stringify(res));
searchResults = res;
console.log('SeachResults after fetch', searchResults);
});
}
" @input="
console.log('Input changed:', searchInput);
matches = [];
if (searchInput.length < 3) { return };
searchResults.forEach(recipe => {
const matchTitle = recipe.name.toLowerCase().includes(searchInput.toLowerCase());
const matchOccupation = recipe.occupation.toLowerCase().includes(searchInput.toLowerCase());
const matchStart = recipe.start.toLowerCase().includes(searchInput.toLowerCase());
const matchDestination = recipe.destination.toLowerCase().includes(searchInput.toLowerCase());
if (!matchTitle && !matchOccupation && !matchStart && !matchDestination) { return };
const match = {...recipe};
if (matchTitle) { match.matchTitle = matchTitle };
if (matchOccupation) { match.matchOccupation = matchOccupation };
if (matchStart) { match.matchStart = matchStart };
if (matchDestination) { match.matchDestination = matchDestination };
matches.push(match)
});
">



