Backend Code only runs in Preview

Thank you again.
Indeed the code does work like that in Preview. Strange.

I’ve been looking closer at the browser log and even before running the below function there’s an error on page load - HTTP/2 403 Forbidden
The error might be as during the import from backend request upon page load?
It shows that the current user is a ‘visitor’ and not a ‘member’ as required.
However the permissions for the jsw module is set to Anyone. I’ve even re-created the module from fresh and reassigned permissions. I tested it with multiple browsers with the same result. I’m logged onto the Dashboard as Owner.
From what I see the individual Dashboard pages does not require additional permissions?

To keep it simple for testing purposes I’ve removed everything else from the function. All it does is call the backend function. I’ve even opted to hardcode the countrycode. It works in Preview exactly as expected but produces the same browser console error in Live (HTTP/3 400 Bad Request) but it seems the permission issue to import the backend module is the problem.


export async function buttonFetch_click(event) {    
    var newData =  await getAdvisoryLevel ('ZA');
    console.log(newData); 
     }   
}