diff options
| author | Adam Soltys <[email protected]> | 2026-02-28 14:14:30 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-02-28 14:14:30 -0800 |
| commit | a1632ae402d11fdd7ffc360de97c55e0b4fad677 (patch) | |
| tree | aad5a1ea73f95dcd055c1d0b4ebf2708c36b4e01 /routes/shopify.ts | |
| parent | 76c7e52172f3dc25ee109434157d4d982ad9d2bd (diff) | |
| download | coinos-server-a1632ae402d11fdd7ffc360de97c55e0b4fad677.tar.gz coinos-server-a1632ae402d11fdd7ffc360de97c55e0b4fad677.zip | |
migrate to hono
Diffstat (limited to 'routes/shopify.ts')
| -rw-r--r-- | routes/shopify.ts | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/routes/shopify.ts b/routes/shopify.ts index d955d73d..abd7c81b 100644 --- a/routes/shopify.ts +++ b/routes/shopify.ts @@ -3,21 +3,20 @@ import { g } from "$lib/db"; import { l, err } from "$lib/logging"; import { getPayment } from "$lib/utils"; -const query = `mutation orderMarkAsPaid($input: OrderMarkAsPaidInput!) { - orderMarkAsPaid(input: $input) { - order { id } - userErrors { +const query = `mutation orderMarkAsPaid($input: OrderMarkAsPaidInput!) { + orderMarkAsPaid(input: $input) { + order { id } + userErrors { field message } } }`; -export default async (req, res) => { - const { - body: { hash }, - params: { id }, - } = req; +export default async (c) => { + const body = await c.req.json(); + const { hash } = body; + const id = c.req.param("id"); const p = await getPayment(hash); const user = await g(`user:${p.uid}`); @@ -39,7 +38,7 @@ export default async (req, res) => { l("shopify success", r); - res.send(r); + return c.json(r); } catch (e) { err("problem marking shopify order as paid", e.message); } |
