reqmeister: middleware/cache, reqmeister, nip05, unfurl, refactor some code

This commit is contained in:
Alex Gleason
2023-12-27 20:07:13 -06:00
parent e121a8805e
commit 2fc9988c06
10 changed files with 39 additions and 30 deletions

View File

@@ -30,7 +30,7 @@ const tagConditions: Record<string, TagCondition> = {
/** Insert an event (and its tags) into the database. */
function insertEvent(event: Event, data: EventData): Promise<void> {
debug('insertEvent', event);
debug('insertEvent', JSON.stringify(event));
return db.transaction().execute(async (trx) => {
/** Insert the event into the database. */

View File

@@ -1,7 +1,9 @@
import { type Insertable } from '@/deps.ts';
import { Debug, type Insertable } from '@/deps.ts';
import { db, type UserRow } from '../db.ts';
const debug = Debug('ditto:users');
interface User {
pubkey: string;
username: string;
@@ -11,6 +13,7 @@ interface User {
/** Adds a user to the database. */
function insertUser(user: Insertable<UserRow>) {
debug('insertUser', JSON.stringify(user));
return db.insertInto('users').values(user).execute();
}