🚧 Begin to refactor the manual connection hook

This commit is contained in:
Philipp Stracker 2024-11-04 16:50:50 +01:00
parent 5a1adc825c
commit c5d7ce211a
No known key found for this signature in database
3 changed files with 41 additions and 18 deletions

View file

@ -155,19 +155,9 @@ export const useOnboardingStep = () => {
};
export const useManualConnect = () => {
const connectManual = async ( clientId, clientSecret, isSandboxMode ) => {
return await apiFetch( {
path: `${ NAMESPACE }/connect_manual`,
method: 'POST',
data: {
clientId,
clientSecret,
useSandbox: isSandboxMode,
},
} );
};
const { connectViaIdAndSecret } = useDispatch( STORE_NAME );
return {
connectManual,
connectManual: connectViaIdAndSecret,
};
};