UNPKG

autumn-js

Version:
22 lines (21 loc) 552 B
"use server"; import { withAuth } from "./auth/withNextAuth"; import { createAutumnClient } from "./cusActions"; import { fetchPricingTable } from "../../sdk"; import { toServerResponse } from "./utils"; const getPricingTableAction = withAuth({ fn: async ({ customerId }) => { let autumn = createAutumnClient(); const res = await fetchPricingTable({ instance: autumn, params: { customer_id: customerId } }); return toServerResponse(res); }, requireCustomer: false }); export { getPricingTableAction };