i am trying to fetch user phone number and other data from collection “Members/PrivateMembersData” but getting “WDE0149 internal application error”
below is code snippet
wixData.query(“Members/PrivateMembersData”)
.find()
.then( (results) => {
// handle the results
console.log(results)
return results
} ).catch(error => {
console.error(‘Error querying database:’, error);
return “null”;
//throw error; // Re-throw the error for proper error handling or debugging
});
i tried same with another collection “Members/FullData” now code is running fine and got result in json form . but all values are null. like
items{
loginEmail:null,
firstName:null,
lastName:null,
phone:null,
sluge:“pravin123”,
nickname:“pravindatir”
}
but
i tried same code with another collection “Members/FullData” now code is running fine and i got result in json form . but all values are null. like
items={
loginEmail:null,
firstName:null,
lastName:null,
phone:null,
sluge:“pravin123”,
nickname:“pravindatir”
}
Got it, thanks. One more question: I want to add user login functionality through phone number and OTP. For this, I want to retrieve the email address by passing its phone number in the backend. So, suppose I write this code as an admin and publish the website. Will this code work for website users?
An ordinary user gets ACCESS to his OWN PRIVATE-DATA → when he is logged-in!
But what you want is to login the USER by his phone-number, which is part of his PRIVATE-DATA.
Take a look, which data you can get out of PUBLIC-DATA.
You will need e-mail and phone-number for your purposes right?
So if the PUBLIC-DATA do not provide those two, what you can do else?
We do not forget → our aim is to get →
a) user-email → because you will need that to be able to login
b) user-phone-number → this is what you want to achieve → LOGIN by PHONENUMBER
So —> USER TYPES IN his → PHONENUMBER → you get that phonenumber → making a search for the corresponding e-mail in the background to replace the phonenumber by email → to be able to login the user.
BYPASS-LOGIN!!!
At least you still can open your own additional database, where you can store the phonenumber and email maybe + user-id in an own separated DATABASE.
This can later be used for your purposes.strong text