deleteMemberPhones( )


Clears a member's phone numbers.

The deleteMemberPhones() function clears the phones array under the contact property.

Note: Only logged-in members can call this function without elevated permissions. To call this function as a different identity, elevated permissions are required.

Permissions
Manage Bookings Services and Settings
Manage Members
Manage Portfolio
Manage Restaurants - all permissions
Learn more about app permissions.
Method Declaration
Copy
function deleteMemberPhones(_id: string): Promise<DeleteMemberPhonesResponse>;
Method Parameters
_idstringRequired

ID of the member whose phone numbers will be deleted.

Returns
Return Type:Promise<DeleteMemberPhonesResponse>
JavaScript
import { Permissions, webMethod } from "wix-web-module"; import { members } from "wix-members.v2"; /* Sample _id value: 'f32cbc51-a331-442b-86c2-2c664613e8b9' */ export const myDeletePhonesFunction = webMethod(Permissions.Anyone, (id) => { return members .deleteMemberPhones(id) .then((updatedMember) => { const phones = updatedMember.contact.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", * "loginEmailVerified": true, * "status": "APPROVED", * "activityStatus": "ACTIVE", * "privacyStatus": "PUBLIC", * "contact": { * "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" * } * } */
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?