Hello all:
I’m having trouble with the members’ area.
What I’m trying to do is a new page, within the members area where users add content and store the information there.
Here are the steps I have taken.
I created a New Page with in the Member Area bar.
Dataset settings: Read & Write and then Filter: Owner - is logged in.
Database Collections Permissions:
-
Read: Sitemember
-
Create: Sitemember
-
Update content: Site member author
-
Delete content: Adming
Only the first user I signed up is working. He can update fine and modify his content, but the input forms for the other users the input form is inactive when they log in.
Does anybody know what I’m doing wrong here?
One of the working theory I have is that when a new user is signed up, and he doesnt have any content in the database, everything becomes inactive.
Maybe something that is inline with this code here…??? (This code is not from my page, but another page using Dynamic Page)
// 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(“Profile”, toInsert)
. catch ( (err) => {
console.log(err);
} );
}
// update buttons accordingly
$w(“#button1”).label = “Logout”;
$w(“#button2”).show();
} )
. catch ( (err) => {
console.log(err);
} );
}
}
See pictures for more info.