MVP
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
import { Context } from "@oak/oak";
|
||||
import { log } from "../log.ts";
|
||||
import { lookupPubkeyByUsername } from "../ldap.ts";
|
||||
import {
|
||||
fetchProfileEvent,
|
||||
fetchReplaceableEvent,
|
||||
} from "../nostr.ts";
|
||||
import { fetchProfileEvent, fetchReplaceableEvent } from "../nostr.ts";
|
||||
import Article from "../models/article.ts";
|
||||
import Profile from "../models/profile.ts";
|
||||
import { articleHtml } from "../html.ts";
|
||||
|
||||
const userEventHandler = async function (ctx: Context) {
|
||||
@@ -24,11 +23,11 @@ const userEventHandler = async function (ctx: Context) {
|
||||
identifier,
|
||||
);
|
||||
const profileEvent = await fetchProfileEvent(pubkey);
|
||||
let profile;
|
||||
|
||||
if (articleEvent && profileEvent) {
|
||||
profile = JSON.parse(profileEvent.content);
|
||||
const html = articleHtml(articleEvent, profile);
|
||||
const article = new Article(articleEvent);
|
||||
const profile = new Profile(profileEvent, username);
|
||||
const html = articleHtml(article, profile);
|
||||
|
||||
ctx.response.body = html;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user