Show list of linked articles on profile page

This commit is contained in:
2024-10-21 00:06:15 +02:00
parent e14adffbc8
commit 18f3e888a6
8 changed files with 93 additions and 32 deletions

View File

@@ -1,11 +1,8 @@
import { Context } from "@oak/oak";
import { nip19 } from "@nostr/tools";
import { log } from "../log.ts";
import { articleHtml } from "../html.ts"
import {
fetchReplaceableEvent,
fetchProfileEvent
} from "../nostr.ts";
import { articleHtml } from "../html.ts";
import { fetchProfileEvent, fetchReplaceableEvent } from "../nostr.ts";
const naddrHandler = async function (ctx: Context) {
const { request } = ctx;
@@ -13,7 +10,10 @@ const naddrHandler = async function (ctx: Context) {
try {
const r = nip19.decode(naddr);
const articleEvent = await fetchReplaceableEvent(r.data.pubkey, r.data.identifier);
const articleEvent = await fetchReplaceableEvent(
r.data.pubkey,
r.data.identifier,
);
const profileEvent = await fetchProfileEvent(r.data.pubkey);
let profile;