Question:
Hello everbody,
I created my own account page, linked to WixMembers.
I would like members to be able to modify their personal data (picture, telephone number, email, address, etc.).
It’s OK for finding the member, and extract “RecupNomClt” & “RecupMailClt”, but I have an error when requesting Update (In the example below, I would like to modify the profile photo.
Error msg in the console : “Uncaught (in promise) R: WDE0004: Failed to save [[object Object]] into [Members/PrivateMembersData].
Items must be JavaScript objects.”
Thanks for your help
Product:
Wix Editor
My Code below :
$w(‘#MAJProfil’).onClick((event) => {
// RECHERCHER LE CLIENT
return wixData.query(‘Members/PrivateMembersData’)
.eq(“_id”, $w(‘#UserID’).value)
.find()
.then(async (results) => {
//1°/ MODIFIER LA PHOTO DU CLIENT
console.log("Effectuer la recherche à partir de l’ID: "+ “(” + $w(‘#UserID’).value + “)”)const RecupNomClt = results.items.map(item => item.name) const RecupMailClt= results.items.map(item => item.loginEmail) console.log("Nom : " + RecupNomClt) console.log("Mail : " + RecupMailClt) const MAJPictClt = results.items.map(item => ({ ...item, picture: $w('#Photoprofil').src})) await wixData.update('Members/PrivateMembersData', MAJPictClt); console.log(results); >
});
})