update channel model

This commit is contained in:
Ren Amamiya
2023-04-25 10:17:36 +07:00
parent 53fd29ddb8
commit 08d2625d36
10 changed files with 168 additions and 129 deletions

View File

@@ -128,13 +128,12 @@ export async function getChannel(id: string) {
}
// create channel
export async function createChannel(event_id: string, metadata: string, created_at: number) {
export async function createChannel(event_id: string, pubkey: string, metadata: string, created_at: number) {
const db = await connect();
return await db.execute('INSERT OR IGNORE INTO channels (event_id, metadata, created_at) VALUES (?, ?, ?);', [
event_id,
metadata,
created_at,
]);
return await db.execute(
'INSERT OR IGNORE INTO channels (event_id, pubkey, metadata, created_at) VALUES (?, ?, ?, ?);',
[event_id, pubkey, metadata, created_at]
);
}
// update channel metadata