Skip to content

Commit

Permalink
Encapsulate showEnrollmentUi in hook, add stub needsEmailVerification
Browse files Browse the repository at this point in the history
  • Loading branch information
ambirdsall committed Jan 17, 2023
1 parent 541a571 commit 56e4a96
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ export const useFreeConnectorProgramInfo = () => {
const requestOptions = { config, middlewares };

return useQuery(["freeConnectorProgramInfo", workspaceId], () =>
webBackendGetFreeConnectorProgramInfoForWorkspace({ workspaceId }, requestOptions)
webBackendGetFreeConnectorProgramInfoForWorkspace({ workspaceId }, requestOptions).then(
({ hasEligibleConnector, hasPaymentAccountSaved }) => {
const showEnrollmentUi = !hasPaymentAccountSaved && hasEligibleConnector;
// TODO hardcoding this value to allow testing while data source gets sorted out
const needsEmailVerification = false;

return { showEnrollmentUi, needsEmailVerification };
}
)
);
};

0 comments on commit 56e4a96

Please sign in to comment.