File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
package/src/libraries/react/hooks Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 1- import { usePricingTableBase } from "./usePricingTableBase" ;
1+ import { usePricingTableBase } from "./usePricingTableBase" ;
22import { ProductDetails } from "../client/types/clientPricingTableTypes" ;
33import { AutumnContext , useAutumnContext } from "@/AutumnContext" ;
44
55export const usePricingTable = ( params ?: {
66 productDetails ?: ProductDetails [ ] ;
7+ entityId ?: string ;
78} ) => {
89 const context = useAutumnContext ( {
910 AutumnContext,
@@ -13,5 +14,6 @@ export const usePricingTable = (params?: {
1314 return usePricingTableBase ( {
1415 client : context . client ,
1516 params,
17+ entityId,
1618 } ) ;
1719} ;
Original file line number Diff line number Diff line change @@ -195,11 +195,16 @@ export const usePricingTableBase = ({
195195 client : AutumnClient | ConvexAutumnClient ;
196196 params ?: {
197197 productDetails ?: ProductDetails [ ] ;
198+ entityId ?: string ;
199+ customerId ?: string ;
198200 } ;
199201} ) => {
200202 const fetcher = async ( ) => {
201203 try {
202- const { data, error } = await client . products . list ( ) ;
204+ const { data, error } = await client . products . list ( {
205+ customerId : params ?. customerId ,
206+ entityId : params ?. entityId ,
207+ } ) ;
203208 if ( error ) throw error ;
204209
205210 return data ?. list || [ ] ;
You can’t perform that action at this time.
0 commit comments