fix: reference

This commit is contained in:
Cory Dransfeldt 2024-10-19 14:14:16 -07:00
parent 5c172e0694
commit e5f86e2a1f
No known key found for this signature in database
3 changed files with 6 additions and 5 deletions

View file

@ -177,10 +177,11 @@ window.addEventListener('load', () => {
try {
const response = await fetch(`https://coryd.dev/api/search?q=${query}&type=${typeQuery}`)
const index = await response.json()
const results = index.results
if (!Array.isArray(data)) return {}
if (!Array.isArray(results)) return {}
resultsById = data.reduce((acc, item) => {
resultsById = results.reduce((acc, item) => {
acc[item.id] = item
return acc
}, {})