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

@@ -16,11 +16,50 @@ export function createAccount(data: CreateAccountData) {
return invoke<Account>('create_account', { data });
}
export function getFollows(data: GetFollowData) {
return invoke<Follow[]>('get_follows', { data });
}
export function createFollow(data: CreateFollowData) {
return invoke<Follow>('create_follow', { data });
}
export type Account = { id: number; pubkey: string; privkey: string; active: boolean; metadata: string };
export type Follow = { id: number; pubkey: string; kind: number; metadata: string; accountId: number };
export function createNote(data: CreateNoteData) {
return invoke<Note>('create_note', { data });
}
export function getNotes() {
return invoke<Note[]>('get_notes');
}
export function checkNote() {
return invoke<Note[]>('check_note');
}
export type GetFollowData = { account_id: number };
export type Note = {
id: number;
eventId: string;
pubkey: string;
kind: number;
tags: string;
content: string;
parent_id: string;
parent_comment_id: string;
createdAt: string;
accountId: number;
};
export type CreateFollowData = { pubkey: string; kind: number; metadata: string; account_id: number };
export type Account = { id: number; pubkey: string; privkey: string; active: boolean; metadata: string };
export type CreateNoteData = {
event_id: string;
pubkey: string;
kind: number;
tags: string;
content: string;
parent_id: string;
parent_comment_id: string;
account_id: number;
};
export type CreateAccountData = { pubkey: string; privkey: string; metadata: string };
export type Follow = { id: number; pubkey: string; kind: number; metadata: string; accountId: number };