Hey guys,
The code was working until 2 days ago but it has suddenly stopped working today
export function claim_click(event) {
let $item = $w.at(event.context);
$item("#claiming").show();
claim($item);
}
function claim($item) {
let claimData = {
claimStatus: 'CLAIMED',
claimerName: $w("#name").text,
claimerImage: $w("#pic").src,
claimerEmail: $w("#email").text,
employeePhone: $w("#phone").text,
approvalStatus: 'PENDING'
};
wixData.query("JobsDB")
.eq('_id', $item("#itemId").text)
.find()
.then((results) => {
let Item = results.items[0];
confirm(claimData, Item, $item);
});
}
async function confirm(claimData, Item, $item) {
Item.claimStatus = claimData.claimStatus;
Item.claimerName = claimData.claimerName;
Item.claimerImage = claimData.claimerImage;
Item.claimerEmail = claimData.claimerEmail;
Item.employeePhone = claimData.employeePhone;
Item.approvalStatus = claimData.approvalStatus;
await wixData.update('JobsDB', Item);
wixLocation.to(`https://www.website.com/someones-dashboard/${$w("#id").text}/success`); //problem here
}
I have tried numerous times on the live site. The Database gets updated but the redirect never happens. I even tried using .then()
Just to clarify, there is nothing wrong with the code.
It was working perfectly but since yesterday the wixLocation line is unreachable. Even if I console.log something after that line, it does not run.
I have the same code running on other pages but its only on 1 particular page that it does not work.
Maybe someone from Wix can help?
You don't need to put the full URL. You can simply do: wixLocation.to('/Your-URL-Here');
I think it's most likely something to do with the getting of the members ID. My site isn't registering the members ID and my Location.to uses the ID of the customer as part of its path (as yours does).
Not too cracking timing considering my website was due to be launched today! 😅
It happened a little while back. Hopefully it'll be rectified soon.
Foowing for updates