aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/ecash
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-02-11 17:51:24 -0800
committerAdam Soltys <[email protected]>2026-02-11 17:51:24 -0800
commit13466248004327e9a026cb89f94926f9b060d1c1 (patch)
tree47b4972c33809ccdf866b043c92cd3e0ecf5dcd0 /src/routes/(app)/ecash
parent3aa9ce1b5985397d7f568887ec6f881df13c1034 (diff)
downloadcoinos-ui-13466248004327e9a026cb89f94926f9b060d1c1.tar.gz
coinos-ui-13466248004327e9a026cb89f94926f9b060d1c1.zip
linting
Diffstat (limited to 'src/routes/(app)/ecash')
-rw-r--r--src/routes/(app)/ecash/[id]/[...version]/+layout.server.ts34
-rw-r--r--src/routes/(app)/ecash/[id]/[...version]/+page.server.ts36
-rw-r--r--src/routes/(app)/ecash/[id]/[...version]/swap/+page.server.ts2
-rw-r--r--src/routes/(app)/ecash/mint/+server.ts4
-rw-r--r--src/routes/(app)/ecash/post/+server.ts14
5 files changed, 45 insertions, 45 deletions
diff --git a/src/routes/(app)/ecash/[id]/[...version]/+layout.server.ts b/src/routes/(app)/ecash/[id]/[...version]/+layout.server.ts
index 50be6986..2093e8ec 100644
--- a/src/routes/(app)/ecash/[id]/[...version]/+layout.server.ts
+++ b/src/routes/(app)/ecash/[id]/[...version]/+layout.server.ts
@@ -2,22 +2,22 @@ import getRates from "$lib/rates";
import { get } from "$lib/utils";
export async function load({ params, parent }) {
- const { user } = await parent();
- const rates = await getRates();
- let { id, version } = params;
- version ||= 4;
- version = parseInt(version);
+ const { user } = await parent();
+ const rates = await getRates();
+ let { id, version } = params;
+ version ||= 4;
+ version = parseInt(version);
- const { token, status } = await get(`/cash/${id}/${version}`);
- const { spent, total, mint, external } = status;
- return {
- id,
- token,
- spent,
- total,
- mint,
- external,
- version,
- rate: rates[user?.currency || "USD"],
- };
+ const { token, status } = await get(`/cash/${id}/${version}`);
+ const { spent, total, mint, external } = status;
+ return {
+ id,
+ token,
+ spent,
+ total,
+ mint,
+ external,
+ version,
+ rate: rates[user?.currency || "USD"],
+ };
}
diff --git a/src/routes/(app)/ecash/[id]/[...version]/+page.server.ts b/src/routes/(app)/ecash/[id]/[...version]/+page.server.ts
index 26ccb307..08efb998 100644
--- a/src/routes/(app)/ecash/[id]/[...version]/+page.server.ts
+++ b/src/routes/(app)/ecash/[id]/[...version]/+page.server.ts
@@ -3,26 +3,26 @@ import { auth, fd, post } from "$lib/utils";
import { fail, redirect } from "@sveltejs/kit";
export async function load({ parent }) {
- const { user } = await parent();
- const rates = await getRates();
- return { rate: rates[user?.currency || "USD"] };
+ const { user } = await parent();
+ const rates = await getRates();
+ return { rate: rates[user?.currency || "USD"] };
}
export const actions = {
- default: async ({ cookies, request, url }) => {
- if (!cookies.get("username"))
- redirect(307, `/register?redirect=${url.pathname}`);
+ default: async ({ cookies, request, url }) => {
+ if (!cookies.get("username"))
+ redirect(307, `/register?redirect=${url.pathname}`);
- const { token } = await fd(request);
- let claimed;
- try {
- claimed = await post("/claim", { token }, auth(cookies));
- claimed = { ok: true };
- } catch (e: any) {
- return fail(400, { error: e.message });
- }
- if (claimed?.ok) {
- redirect(307, "/payments");
- }
- },
+ const { token } = await fd(request);
+ let claimed;
+ try {
+ claimed = await post("/claim", { token }, auth(cookies));
+ claimed = { ok: true };
+ } catch (e: any) {
+ return fail(400, { error: e.message });
+ }
+ if (claimed?.ok) {
+ redirect(307, "/payments");
+ }
+ },
};
diff --git a/src/routes/(app)/ecash/[id]/[...version]/swap/+page.server.ts b/src/routes/(app)/ecash/[id]/[...version]/swap/+page.server.ts
index f82bdbb1..14e4767d 100644
--- a/src/routes/(app)/ecash/[id]/[...version]/swap/+page.server.ts
+++ b/src/routes/(app)/ecash/[id]/[...version]/swap/+page.server.ts
@@ -1,3 +1,3 @@
export async function load() {
- return { test: 123 };
+ return { test: 123 };
}
diff --git a/src/routes/(app)/ecash/mint/+server.ts b/src/routes/(app)/ecash/mint/+server.ts
index 02170650..e933208e 100644
--- a/src/routes/(app)/ecash/mint/+server.ts
+++ b/src/routes/(app)/ecash/mint/+server.ts
@@ -2,6 +2,6 @@ import { auth, post } from "$lib/utils";
import { json } from "@sveltejs/kit";
export async function POST({ cookies, request }) {
- const result = await post("/mint", await request.json(), auth(cookies));
- return json(result);
+ const result = await post("/mint", await request.json(), auth(cookies));
+ return json(result);
}
diff --git a/src/routes/(app)/ecash/post/+server.ts b/src/routes/(app)/ecash/post/+server.ts
index bc6cb099..371582bc 100644
--- a/src/routes/(app)/ecash/post/+server.ts
+++ b/src/routes/(app)/ecash/post/+server.ts
@@ -1,11 +1,11 @@
import { json } from "@sveltejs/kit";
export async function POST({ fetch, request }) {
- const { target, payload } = await request.json();
- const res = await fetch(target, {
- method: "POST",
- body: JSON.stringify(payload),
- headers: { "Content-Type": "application/json" },
- });
- return json(res);
+ const { target, payload } = await request.json();
+ const res = await fetch(target, {
+ method: "POST",
+ body: JSON.stringify(payload),
+ headers: { "Content-Type": "application/json" },
+ });
+ return json(res);
}