mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-08 16:14:22 +01:00
reqmeister: middleware/cache, reqmeister, nip05, unfurl, refactor some code
This commit is contained in:
@@ -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. */
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user