converted full sql from onboarding flow to prisma

This commit is contained in:
Ren Amamiya
2023-04-03 15:03:07 +07:00
parent 33000979ed
commit 3f87d510ab
14 changed files with 314 additions and 74 deletions

View File

@@ -41,7 +41,7 @@ export default function Page() {
};
// auto-generated profile metadata
const metadata = useMemo(
const metadata: any = useMemo(
() => ({
display_name: name,
name: name,
@@ -77,7 +77,7 @@ export default function Page() {
event.sig = signEvent(event, privKey);
// insert to database then broadcast
createAccount({ pubkey: pubKey, privkey: privKey, metadata: JSON.stringify(metadata) })
createAccount({ pubkey: pubKey, privkey: privKey, metadata: metadata })
.then((res) => {
pool.publish(event, relays);
router.push({

View File

@@ -85,7 +85,9 @@ export default function Page() {
for (const follow of follows) {
const metadata: any = await fetchMetadata(follow, pool, relays);
createFollow({ pubkey: follow, kind: 0, metadata: metadata.content, account_id: parseInt(id) });
createFollow({ pubkey: follow, kind: 0, metadata: metadata.content, account_id: parseInt(id) }).catch(
console.error
);
}
// build event