UNPKG

autumn-js

Version:
31 lines (28 loc) 616 B
import { withAuth } from "./chunk-UJBSJTAV.mjs"; import { BASE_PATH } from "./chunk-KSG3E4Q2.mjs"; // src/libraries/backend/routes/productRoutes.ts import { addRoute } from "rou3"; var listProductsHandler = (options) => withAuth({ fn: async ({ autumn, customer_id }) => { return await autumn.products.list({ customer_id }); }, requireCustomer: false, suppressLogs: options?.suppressLogs }); var addProductRoutes = async (router, options) => { addRoute(router, "GET", `${BASE_PATH}/products`, { handler: listProductsHandler(options) }); }; export { addProductRoutes };