wip: refactor chats to use zustand

This commit is contained in:
Ren Amamiya
2023-05-27 12:14:30 +07:00
parent 671b857077
commit 79e948ac05
21 changed files with 229 additions and 278 deletions

View File

@@ -297,12 +297,13 @@ export async function createChat(
receiver_pubkey: string,
sender_pubkey: string,
content: string,
tags: string[][],
created_at: number,
) {
const db = await connect();
return await db.execute(
"INSERT OR IGNORE INTO chats (event_id, receiver_pubkey, sender_pubkey, content, created_at) VALUES (?, ?, ?, ?, ?);",
[event_id, receiver_pubkey, sender_pubkey, content, created_at],
"INSERT OR IGNORE INTO chats (event_id, receiver_pubkey, sender_pubkey, content, tags, created_at) VALUES (?, ?, ?, ?, ?, ?);",
[event_id, receiver_pubkey, sender_pubkey, content, tags, created_at],
);
}