Skip to content

Commit

Permalink
fix(hooks): improve optional chaining in bank account verification block
Browse files Browse the repository at this point in the history
- Refactor code to use optional chaining for better safety
- Ensure proper data checks against undefined values
  • Loading branch information
tomer-shvadron committed Feb 9, 2025
1 parent 9024d11 commit f0e31e4
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { createBlocksTyped } from '@/lib/blocks/create-blocks-typed/create-block
export const useBankAccountVerificationBlock = ({ pluginsOutput }) => {
return useMemo(() => {
if (
Object.keys(pluginsOutput?.bankAccountVerification?.data.clientResponsePayload ?? {})
Object.keys(pluginsOutput?.bankAccountVerification?.data?.clientResponsePayload ?? {})
.length === 0
) {
return [];
Expand Down Expand Up @@ -65,7 +65,7 @@ export const useBankAccountVerificationBlock = ({ pluginsOutput }) => {
})
.build();
}, [
pluginsOutput?.bankAccountVerification?.data.clientResponsePayload,
pluginsOutput?.bankAccountVerification?.data.responseHeader.overallResponse,
pluginsOutput?.bankAccountVerification?.data?.clientResponsePayload,
pluginsOutput?.bankAccountVerification?.data?.responseHeader?.overallResponse,
]);
};

0 comments on commit f0e31e4

Please sign in to comment.