Deprecated. This function will continue to work, but a newer version is available at deleteMemberPhones().
Clears a member's phone numbers.
The deleteMemberPhones()
function returns a Promise that resolves to a member object
when the specified member's phone numbers are cleared.
deleteMemberPhones()
deletes all phone numbers from the contactDetails.phones
array,
which affects both the specified member and the attached contact.
If this function is already in your code, it will continue to work. To stay compatible with future changes, migrate to deleteMemberPhones().
To migrate to the new function:
Add the new import statement:
import { members } from "wix-members.v2";
Test your changes to make sure your code behaves as expected.
function deleteMemberPhones(id: string): Promise<Member>;
ID of the member whose phone numbers will be deleted.
This example uses a deprecated function.
import { Permissions, webMethod } from "wix-web-module";
import { members } from "wix-members-backend";
// Sample id value:
// 'f32cbc51-a331-442b-86c2-2c664613e8b9'
export const myDeletePhonesFunction = webMethod(Permissions.Anyone, (id) => {
return members
.deleteMemberPhones(id)
.then((updatedMember) => {
const phones = updatedMember.contactDetails.phones;
return updatedMember;
})
.catch((error) => {
console.error(error);
});
});
/* Promise resolves to:
* {
* "_id": "f32cbc51-a331-442b-86c2-2c664613e8b9",
* "_createdDate": "2021-08-02T23:14:42.000Z",
* "_updatedDate": "2021-08-02T23:14:58.345Z",
* "lastLoginDate": "2021-08-02T23:17:29.000Z",
* "contactId": "f32cbc51-a331-442b-86c2-2c664613e8b9",
* "loginEmail": "claude.morales@example.com",
* "status": "APPROVED",
* "activityStatus": "ACTIVE",
* "privacyStatus": "PUBLIC",
* "contactDetails": {
* "firstName": "Claude",
* "lastName": "Morales",
* "phones": [],
* "emails": [
* "claude.morales@example.com"
* ],
* "addresses": [
* {
* "_id": "f0f4d905-488d-44db-9080-fc29078cfad5",
* "addressLine": "9373 Park Avenue",
* "addressLine2": "Berkshire",
* "city": "Ely",
* "subdivision": "GB-ENG",
* "country": "GB",
* "postalCode": "PD50 8EU"
* }
* ],
* "customFields": {}
* },
* "profile": {
* "nickname": "Claude Morales",
* "slug": "claudemorales"
* }
* }
*/
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.