Typing all the types
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user