added current status to user

This commit is contained in:
Ren Amamiya
2023-02-23 14:57:39 +07:00
parent 1796228116
commit 31a3a712ec
7 changed files with 23 additions and 15 deletions
+2 -2
View File
@@ -34,12 +34,12 @@ export default function Page() {
const insertDB = async () => {
const db = await Database.load('sqlite:lume.db');
await db.execute(
`INSERT INTO followings (pubkey, account) VALUES ("${$currentUser.pubkey}", "${$currentUser.pubkey}")`
`INSERT INTO follows (pubkey, account) VALUES ("${$currentUser.pubkey}", "${$currentUser.pubkey}")`
);
follow.forEach(async (npub) => {
const { data } = nip19.decode(npub);
await db.execute(
`INSERT INTO followings (pubkey, account) VALUES ("${data}", "${$currentUser.pubkey}")`
`INSERT INTO follows (pubkey, account) VALUES ("${data}", "${$currentUser.pubkey}")`
);
});
};