Hooks
Description of the hooks contained in the module
usePayrollSwitchRegister
How to use the hook?
import {usePayrollSwitchRegister} from 'LinkerStudio/modules/payroll/common/hooks/usePayrollSwitchRegister';const [register] = usePayrollSwitchRegister();const openPayrollModal = useCallback(async () => {
const linkTokenRes = await register();
if (!linkTokenRes || linkTokenRes?.status !== 201) {
// Something went wrong
}
// Save linkTokenRes data to use it
setLinkToken(linkTokenRes?.data.data.data.token || '');
// Open payroll widget
}, [register]);Last updated