How to make member profile public?

import { currentMember } from 'wix-members-frontend';

// ...

currentMember.makeProfilePublic()
  .then((updatedMember) => {
    const newPrivacyStatus = updatedMember.privacyStatus;
    console.log('Privacy status was changed to', newPrivacyStatus);
  })
  .catch((error) => {
    console.error(error);
  });

I tried this code but nothing happened. Please help.

I do not see anything immediately wrong with your use of makeProfilePublic()

Is this code placed on a page?

Are there any errors in the console? If so, please paste them here.

Thanks for the reply. I tried this above in code in every possible way. Privacy status is not changing at all. Is there any other way? Please help

There are two methods you can use to make a member profile public using the Velo API.

makeProfilePublic() from the Wix Members Frontend API

makeProfilePublic() from the Wix Members Backend API

While they both work similarly, the main difference is where the method is placed (Page Code vs Backend Web Module)

Without an error, it is hard for me to make any specific recommendation. I would first try to check the Site Logs for any errors when the method is called to see what is going on.