Typing all the types

This commit is contained in:
2024-10-23 00:27:20 +02:00
parent edaf5f5c71
commit 46ad9813eb
15 changed files with 97 additions and 105 deletions

View File

@@ -1,5 +1,4 @@
import { Context } from "@oak/oak";
import { log } from "../log.ts";
import { lookupPubkeyByUsername } from "../directory.ts";
import { fetchProfileEvent, fetchReplaceableEvent } from "../nostr.ts";
import Article from "../models/article.ts";
@@ -8,8 +7,8 @@ import { articleHtml } from "../html.ts";
import notFoundHandler from "../handlers/not-found.ts";
const userEventHandler = async function (ctx: Context) {
const username = ctx.params.user.replace(/^(@|~)/, "");
const identifier = ctx.params.identifier;
const username = ctx.state.username.replace(/^(@|~)/, "");
const identifier = ctx.state.identifier;
const pubkey = await lookupPubkeyByUsername(username);
if (!pubkey) {
@@ -33,8 +32,7 @@ const userEventHandler = async function (ctx: Context) {
} else {
notFoundHandler(ctx);
}
} catch (e) {
log(e, "yellow");
} catch (_e) {
notFoundHandler(ctx);
}
};