I am having the same issue, I used the URL from the dynamic page but it does not find the page. Here is my code, can you please let me know what I am doing wrong here?
import wixData from ‘wix-data’ ;
import wixLocation from ‘wix-location’ ;
export function loginButton_click(event,$w) {
let email = $w( ‘#email’ ).value;
let password = $w( ‘#password’ ).value;
wixData.query( “CompanyProfile” )
.eq( ‘email’ , email)
.eq( ‘password’ , password)
.find()
.then((results) => {
if (results.items.length > 0 ) {
let url = results.items[ 0 ].id ;
wixLocation.to( ‘/about1/${url}’ )
$w( '#welcome' ).show();
$w( '#errorMsg' ).hide();
$w( '#accountNavBar1' ).hide();
$w( '#button130' ).hide();
$w( '#txrProfile' ).show();
$w( '#btnProfile' ).show();
}
if (results.items.length === 0 ) {
$w( ‘#errorMsg’ ).show();
}
})
. catch ((err) => {
console.log( “err” , err);
});
}