Add orders page

This commit is contained in:
Dominic Ferrando
2026-07-17 15:18:06 -04:00
parent d4dacbaded
commit 086f458db5
4 changed files with 100 additions and 3 deletions
+15 -3
View File
@@ -199,8 +199,8 @@ export const app = new Elysia()
)
// COMMERCE
.group("/commerce", (app) => app
.group("/products", { auth: true }, (app) => app
.group("/commerce", { auth: true }, (app) => app
.group("/products", (app) => app
.group("/sync", (app) => app
// Sync status
.get("/", async ({ sessionId }) => {
@@ -234,7 +234,19 @@ export const app = new Elysia()
return { pProduct, wProduct };
}, {
params: t.Object({ pProductId: t.Numeric() })
})))
})
)
.group("/orders", (app) => app
.get("/:wOrderId", async ({ params: { wOrderId } }) => {
const wOrder = await s.Commerce.Webflow.Orders.get(wOrderId);
if (!wOrder) throw new NotFoundError("Missing webflow order");
const pOrder = await s.Commerce.Printful.Orders.get(`@${wOrder.orderId}`);
return { wOrder, pOrder };
}, { params: t.Object({ wOrderId: t.String() }) })
)
)
// EVENTS
.group("/events", { auth: true }, (app) => app