diff options
| author | Adam Soltys <[email protected]> | 2025-01-23 12:29:55 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-01-23 12:29:55 -0800 |
| commit | a1f4ed6408655dde0f1e6d71f7a571571b9cc826 (patch) | |
| tree | 75e3ca5b21470c5f42f0fc7beb94691fd9a08cda | |
| parent | 7ae9d76d8e625ab321786ef524da386408268a1f (diff) | |
| download | coinos-server-a1f4ed6408655dde0f1e6d71f7a571571b9cc826.tar.gz coinos-server-a1f4ed6408655dde0f1e6d71f7a571571b9cc826.zip | |
pubkeys
| -rw-r--r-- | routes/nostr.ts | 7 |
1 files 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) { |
