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 { fetchArticlesByAuthor, fetchProfileEvent } from "../nostr.ts";
|
||||
import Article from "../models/article.ts";
|
||||
@@ -8,7 +7,7 @@ import { profilePageHtml } from "../html.ts";
|
||||
import notFoundHandler from "../handlers/not-found.ts";
|
||||
|
||||
const userProfileHandler = async function (ctx: Context) {
|
||||
const username = ctx.params.path.replace(/^(@|~)/, "");
|
||||
const username = ctx.state.path.replace(/^(@|~)/, "");
|
||||
const pubkey = await lookupPubkeyByUsername(username);
|
||||
|
||||
if (!pubkey) {
|
||||
@@ -27,11 +26,9 @@ const userProfileHandler = async function (ctx: Context) {
|
||||
|
||||
ctx.response.body = html;
|
||||
} else {
|
||||
log(`No profile event found for @${username}`, "yellow");
|
||||
notFoundHandler(ctx);
|
||||
}
|
||||
} catch (e) {
|
||||
log(e, "yellow");
|
||||
} catch (_e) {
|
||||
notFoundHandler(ctx);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user