Hi.
I have some rows in my members collection which have empty _owner fields. Not all of the rows, mind you, just some of them. Of course, this makes it difficult when I do an update(), because it fails with a permissions error. Please give me ideas on what is going wrong!
The code to insert is here:
export function saveProfileButton_onClick(event, $w) {
var userID = wixUsers.currentUser.id;
$w("#textEmail").text = email;
var toInsert = {
"_id" : userID,
"email" : email,
"firstname": $w("#inputFirstName").value,
"lastname": $w("#inputLastName").value,
"about": $w("#textBoxAbout").value,
"childsfirstname" : $w("#inputChildsFirstName").value,
"childslastname": $w("#inputChildsLastName").value,
"aboutChild": $w("#textBoxAboutChild").value,
"profilePic" : $w("#imageMemberPic").src,
"childsPic" : $w("#imageChildsPic").src,
"childsDob" : $w("#datePickerChildsDOB").value
};
wixData.insert("members", toInsert)
.then( (results) => {
console.log("Inserted member:");
console.log(results);
wixLocation.to(wixLocation.baseUrl);
})
.catch( (err) => {
console.log(err);
});
}