Add orders page
This commit is contained in:
+15
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user