i Have the same error as Tiaan, Mr. Mikhail Spirin,can you please help me to resolve this error, i already sent you my link in your facebook messanger and also check details mentioned below :
i have followed all your steps for creating custome member login page and done coding accordingly but it is not working showing some error, please help me…the below is the links
Page Link :
https://editor.wix.com/html/editor/web/renderer/edit/7b1a1493-bd68-433a-889f-7c382be000cc?metaSiteId=cc46de08-d072-4d32-896e-6612cf62d781&editorSessionId=FC3DE292-3B89-44DC-93A5-5C7A9CDDADEC
Error link: https://gdexindia.wixsite.com/gdexindia11/Member/Update/ID
My Wix Account Log in Link : https://www.wix.com/my-account/sites/cc46de08-d072-4d32-896e-6612cf62d781/site-settings/overview?referrer=site-home
my coding :
import wixUsers from ‘wix-users’;
import wixData from ‘wix-data’;
import wixLocation from ‘wix-location’;
$w.onReady( () => {
if(wixUsers.currentUser.loggedIn) {
$w(“#button1”).label = “Logout”;
$w(“#button2”).show();
}
else {
$w(“#button1”).label = “Login”;
$w(“#button2”).hide();
}
} );
export function button1_onclick() {
// user is logged in
if(wixUsers.currentUser.loggedIn) {
// log the user out
wixUsers.logout()
.then( () => {
// update buttons accordingly
$w(“#button1”).label = “Login”;
$w(“#button2”).hide();
} );
}
// user is logged out
else {
let userId;
let userEmail;
// prompt the user to log in
wixUsers.promptLogin( {"mode": "login"} )
.then( (user) => {
userId = [user.id](http://user.id/) ;
return user.getEmail();
} )
.then( (email) => {
// check if there is an item for the user in the collection
userEmail = email;
return wixData.query("Member")
.eq("_id", userId)
.find();
} )
.then( (results) => {
// if an item for the user is not found
if (results.items.length === 0) {
// create an item
const toInsert = {
"_id": userId,
"email": userEmail
};
// add the item to the collection
wixData.insert("Member", toInsert)
.catch( (err) => {
console.log(err);
} );
}
// update buttons accordingly
$w("#button1").label = "Logout";
$w("#button2").show();
} )
.catch( (err) => {
console.log(err);
} );
}
}
export function button2_onclick() {
wixLocation.to (/Member/Update/ID ${ [wixUsers.currentUser.id](http://wixusers.currentuser.id/) }
);
}
Note : I want to Add and Additional Accounting Area or Table through which my member can view their Balance and account statement (How to Add it i dont know) because i just follow your steps in coding and creating website…i am not technical and IT Person …but interested to create website according to my requirement
Request you to Please give or add coding for Basic account statement generation like Account No., Amount Deposit,Withdraw, Final Balance in Table form in the above mention code
So Please Help me as soon as possible