feat: improve some functions

This commit is contained in:
reya
2024-08-04 10:23:15 +07:00
parent 35620fb1a9
commit 587fd7301b
6 changed files with 79 additions and 35 deletions

View File

@@ -12,6 +12,14 @@ try {
else return { status: "error", error: e as any };
}
},
async deleteAccount(id: string) : Promise<Result<null, string>> {
try {
return { status: "ok", data: await TAURI_INVOKE("delete_account", { id }) };
} catch (e) {
if(e instanceof Error) throw e;
else return { status: "error", error: e as any };
}
},
async createAccount(name: string, picture: string | null) : Promise<Result<string, string>> {
try {
return { status: "ok", data: await TAURI_INVOKE("create_account", { name, picture }) };