added create channel to sql and browse channels page

This commit is contained in:
Ren Amamiya
2023-04-10 11:29:06 +07:00
parent 549cc991a9
commit 213d7514d2
7 changed files with 95 additions and 6 deletions

View File

@@ -44,6 +44,10 @@ export function getNoteById(data: GetNoteByIdData) {
return invoke<Note | null>('get_note_by_id', { data });
}
export function createChannel(data: CreateChannelData) {
return invoke<Channel>('create_channel', { data });
}
export type CreateNoteData = {
event_id: string;
pubkey: string;
@@ -55,6 +59,7 @@ export type CreateNoteData = {
created_at: number;
account_id: number;
};
export type CreateChannelData = { event_id: string; content: string };
export type CreatePlebData = { pleb_id: string; pubkey: string; kind: number; metadata: string; account_id: number };
export type GetNoteByIdData = { event_id: string };
export type Pleb = { id: number; plebId: string; pubkey: string; kind: number; metadata: string; accountId: number };
@@ -71,6 +76,7 @@ export type Note = {
accountId: number;
};
export type Account = { id: number; pubkey: string; privkey: string; active: boolean; metadata: string };
export type Channel = { id: number; eventId: string; content: string };
export type GetPlebPubkeyData = { pubkey: string };
export type GetPlebData = { account_id: number };
export type CreateAccountData = { pubkey: string; privkey: string; metadata: string };