fix: reference
This commit is contained in:
parent
5c172e0694
commit
e5f86e2a1f
3 changed files with 6 additions and 5 deletions
|
@ -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
|
||||
}, {})
|
||||
|
|
Reference in a new issue