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

4
package-lock.json generated
View file

@ -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",

View file

@ -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": {

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
}, {})