Hi all,
I am managing to insert profile information into a collection at user signup, but for some reason setting the _owner value has only worked for me once (and I don’t remember changing this code). Is there anything more I’d need to do to allow setting the _owner field?
return wixUsers.register(email, password, {
"contactInfo": {
"emails": emails,
"labels": labels
}
})
.then((results) => {
let userNameLowCase = userName.toLowerCase();
let userProfileToInsert = {
"userName": userName,
"userNameLowerCase": userNameLowCase,
"_owner": results.user.id,
};
console.log(userProfileToInsert);
wixData.insert("userProfile", userProfileToInsert)
.then((insertResult) => {
console.log(insertResult);
})
The rows are being inserted into the collection, but the _owner field isn’t getting saved. I did manage to do so once, so it’s probably not related to permissions. userProfile includes _owner, but insertResult does not…
Appreciate your input on this!