fix: reference
This commit is contained in:
parent
5c172e0694
commit
e5f86e2a1f
3 changed files with 6 additions and 5 deletions
4
package-lock.json
generated
4
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "coryd.dev",
|
||||
"version": "1.5.3",
|
||||
"version": "1.5.4",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "coryd.dev",
|
||||
"version": "1.5.3",
|
||||
"version": "1.5.4",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@cdransf/api-text": "^1.5.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "coryd.dev",
|
||||
"version": "1.5.3",
|
||||
"version": "1.5.4",
|
||||
"description": "The source for my personal site. Built using 11ty (and other tools).",
|
||||
"type": "module",
|
||||
"engines": {
|
||||
|
|
|
@ -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