Reload page inside then

This commit is contained in:
dinamiko 2022-04-14 15:52:22 +02:00
parent b303804f81
commit 42ce61de5b
2 changed files with 7 additions and 6 deletions

View file

@ -73,7 +73,10 @@ const ppcp_onboarding = {
const onboard_pui = document.querySelector('#ppcp-onboarding-pui');
onboard_pui.addEventListener('click', (event) => {
event.preventDefault();
event.preventDefault();
buttons.forEach((element) => {
element.removeAttribute('href');
});
fetch(PayPalCommerceGatewayOnboarding.pui_endpoint, {
method: 'POST',
@ -84,10 +87,8 @@ const ppcp_onboarding = {
}).then((res)=>{
return res.json();
}).then((data)=>{
console.log(data)
location.reload();
});
location.reload();
})
},