aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/routes/actual.remote.ts
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/routes/actual.remote.ts')
-rw-r--r--app/src/routes/actual.remote.ts10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/src/routes/actual.remote.ts b/app/src/routes/actual.remote.ts
index bcf5d37..535e387 100644
--- a/app/src/routes/actual.remote.ts
+++ b/app/src/routes/actual.remote.ts
@@ -1,10 +1,10 @@
-import { command } from "$app/server";
+import { command, query } from "$app/server";
import { ACTUAL_HOST, ACTUAL_PASS } from "$env/static/private";
import * as actual from "@actual-app/api"
import { existsSync, mkdirSync } from "node:fs";
import path from "node:path";
-export const initActual = command(async () => {
+async function initActual() {
const dataDir = path.resolve(__dirname, "actualDataDir");
if (!existsSync(dataDir)) mkdirSync(dataDir);
@@ -14,4 +14,10 @@ export const initActual = command(async () => {
serverURL: ACTUAL_HOST,
dataDir: dataDir
})
+}
+
+export const getActualMeta = query(async () => {
+ await initActual()
+ const accounts = await actual.getAccounts()
+ return
}) \ No newline at end of file