// Get husband information
const getHusbandInformationByGuid = useCallback(async () => {
const res = await trackPromise(api.getPersonalInformationByGuid(profileGuid));
console.log('Profile information', res);
setHusbandData(res?.data?.Output);
}, [profileGuid, trackPromise, api, setHusbandData]);
// Get spouse information
const getSpouseInformationByGuid = useCallback(async () => {
const res = await trackPromise(api.getPersonalInformationByGuid(spouseGuid));
console.log('Spouse information', res);
setSpouseData(res?.data?.Output);
}, [spouseGuid, trackPromise, api, setSpouseData]);
// Revert back to previous values after testing
React.useEffect(() => {
// if (spouseGuid && profileGuid) {
if (profileGuid) getHusbandInformationByGuid();
if (spouseGuid) getSpouseInformationByGuid();
// }
}, [profileGuid, spouseGuid]);
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter