I have the following code on a member page(only available when they are logged in)
console.log(‘current user is ‘+userId);
let myuserinfo = getUser(userId);
console.log(myuserinfo);
$w(’#debugtext’).text = myuserinfo.id;
In my Backend code I have the following
export function getUser(userId) {
// console.log(userId);
let UserInfo = wixUsers.getUser(userId);
console.log(‘before userinfo’)
console.log(UserInfo);
console.log(‘after userinfo’);
return UserInfo;
}
this is what I get on the debug console when running on live site.
11/14/2019, 12:02:20.675 PMcurrent user is 7ffbd8c3-22d0-47f8-a712-de18c4d9f0d9INFO11/14/2019, 12:02:20.675 PM{}INFO11/14/2019, 12:02:20.675 PMWix code SDK Warning: The text parameter of “debugtext” that is passed to the text method cannot be …WARNING11/14/2019, 12:02:20.332 PM[{“isFulfilled”:false,“isRejected”:false}]INFO11/14/2019, 12:02:20.321 PM[“before userinfo”]INFO11/14/2019, 12:02:20.313 PM[“after userinfo”]INFO
I really need to finish this project this week. I can call the new new function below to set what I need set, but I can get the current settings. In the end I need the end user to be able to set options that will update the labels attached to them.
function updateUserFields(userId: string, userInfo: UserInfo): Promise<void>