From e5f86e2a1f1ec9e59d5df453a44aff1586907d30 Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Sat, 19 Oct 2024 14:14:16 -0700 Subject: [PATCH] fix: reference --- package-lock.json | 4 ++-- package.json | 2 +- src/assets/scripts/index.js | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 70e609ac..dc0c652d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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", diff --git a/package.json b/package.json index 44ba07c0..f4dece98 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/src/assets/scripts/index.js b/src/assets/scripts/index.js index 62048a36..cb3570df 100644 --- a/src/assets/scripts/index.js +++ b/src/assets/scripts/index.js @@ -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 }, {})