From 0aabb866c2fb18d4b0bb655eccc89453185b53c3 Mon Sep 17 00:00:00 2001 From: Paperclip Date: Sun, 12 Apr 2026 23:56:02 +0000 Subject: [PATCH] GRO-607: Add /portal/config endpoint + rename date field MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add GET /portal/config returning stripePublishableKey from env - Rename createdAt→date in invoice response to match BillingPayments interface Co-Authored-By: Paperclip --- apps/api/src/routes/portal.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/api/src/routes/portal.ts b/apps/api/src/routes/portal.ts index dd58d0a..d6b5656 100644 --- a/apps/api/src/routes/portal.ts +++ b/apps/api/src/routes/portal.ts @@ -35,6 +35,12 @@ portalRouter.get("/me", async (c) => { return c.json({ id: client.id, name: client.name, email: client.email, phone: client.phone }); }); +portalRouter.get("/config", async (c) => { + return c.json({ + stripePublishableKey: process.env.STRIPE_PUBLISHABLE_KEY ?? "", + }); +}); + portalRouter.get("/services", async (c) => { const db = getDb(); const allServices = await db.select().from(services).where(eq(services.active, true)); @@ -123,7 +129,7 @@ portalRouter.get("/invoices", async (c) => { id: inv.id, status: inv.status, totalCents: inv.totalCents, - createdAt: inv.createdAt, + date: inv.createdAt, lineItems: (itemsByInvoice[inv.id] || []).map(li => ({ id: li.id, description: li.description, quantity: li.quantity, unitPriceCents: li.unitPriceCents, totalCents: li.totalCents })), }))); });