Skip to content

Commit

Permalink
clients/web: avoid to query customer when showing benefit, since it's…
Browse files Browse the repository at this point in the history
… already embedded
  • Loading branch information
frankie567 committed Dec 20, 2024
1 parent e9aac75 commit 7697412
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions clients/apps/web/src/components/Benefit/BenefitGrant.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import {
useCustomerBenefitGrantUpdate,
useCustomerPortalCustomer,
} from '@/hooks/queries'
import { useCustomerBenefitGrantUpdate } from '@/hooks/queries'
import {
CustomerBenefitGrant,
CustomerBenefitGrantCustom,
Expand Down Expand Up @@ -73,11 +70,10 @@ const BenefitGrantOAuth = ({
}) => {
const pathname = usePathname()
const {
customer_id,
customer,
properties: { account_id },
benefit: { type: benefitType },
} = benefitGrant
const { data: customer } = useCustomerPortalCustomer(api, customer_id)
const accounts = useMemo(
() =>
customer
Expand All @@ -94,11 +90,11 @@ const BenefitGrantOAuth = ({
{
platform,
returnTo: pathname,
customerId: customer_id,
customerId: customer.id,
},
)
window.location.href = url
}, [customer_id, api, pathname, platform])
}, [customer, api, pathname, platform])

const updateBenefitGrant = useCustomerBenefitGrantUpdate(api)
const [selectedAccountKey, setSelectedAccountKey] = useState<
Expand Down

0 comments on commit 7697412

Please sign in to comment.