From b76cb434f86cb985a9be7fd76a4fbf0ca08e445e Mon Sep 17 00:00:00 2001 From: scanash00 Date: Wed, 1 Apr 2026 11:18:17 -0800 Subject: [PATCH] fix --- web/src/pages/[...appPath].astro | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/src/pages/[...appPath].astro b/web/src/pages/[...appPath].astro index ea74f8e..b181fcf 100644 --- a/web/src/pages/[...appPath].astro +++ b/web/src/pages/[...appPath].astro @@ -43,7 +43,9 @@ try { } if (uri) { - const res = await fetch(`${API_URL}/api/annotation?uri=${encodeURIComponent(uri)}`); + const isCollection = uri.includes('/at.margin.collection/'); + const endpoint = isCollection ? 'collection' : 'annotation'; + const res = await fetch(`${API_URL}/api/${endpoint}?uri=${encodeURIComponent(uri)}`); if (res.ok) { const item = await res.json(); const author = item.author || item.creator || {}; @@ -63,7 +65,7 @@ try { ? `${targetTitle} — bookmarked by @${handle}` : `Bookmark by @${handle}`; description = bodyText?.slice(0, 200) || 'A bookmark on Margin'; - } else if (uri.includes('/at.margin.collection/')) { + } else if (isCollection) { title = `${item.name || 'Collection'} by @${handle}`; description = item.description?.slice(0, 200) || 'A collection on Margin'; } else { -- 2.51.2