From a1f4ed6408655dde0f1e6d71f7a571571b9cc826 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 23 Jan 2025 12:29:55 -0800 Subject: pubkeys --- routes/nostr.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/routes/nostr.ts b/routes/nostr.ts index a8a724fa..64ada29e 100644 --- a/routes/nostr.ts +++ b/routes/nostr.ts @@ -178,7 +178,8 @@ export default { query: { limit = 20, offset = 0, pubkeysOnly }, } = req; try { - let follows = await g(`${pubkey}:follows`); + const k = `${pubkey}:follows${pubkeysOnly ? ":pubkeys" : ""}`; + let follows = await g(k); if (follows?.length) return res.send(follows); const event = await get({ authors: [pubkey], kinds: [3] }); @@ -204,9 +205,7 @@ export default { .map((r) => r.value); } - await db.set(`${pubkey}:follows`, JSON.stringify(follows), { - EX: 300, - }); + await db.set(k, JSON.stringify(follows), { EX: 300 }); res.send(follows); } catch (e) { -- cgit v1.2.3