Search.../

deleteMemberAddresses( )

Deletes a member's street addresses.

Description

The deleteMemberAddresses() function returns a Promise that resolves to a member object when the specified member's addresses are cleared.

deleteMemberAddresses() deletes all addresses in the contactDetails.addresses array, which affects both the specified member and the attached contact.

Syntax

function deleteMemberAddresses(id: string): Promise<Member>

deleteMemberAddresses Parameters

NAME
TYPE
DESCRIPTION
id
string

ID of the member whose street addresses will be deleted.

Returns

Fulfilled - Updated member. Rejected - Error message.

Return Type:

Promise<Member>
NAME
TYPE
DESCRIPTION
_id
string

Member ID.

loginEmail
string

Email used by the member to log in to the site.

status
string

Member site access status.

One of:

  • "PENDING": Member created and is waiting for approval by site owner.
  • "APPROVED": Member can log in to the site.
  • "OFFLINE": Member is a guest author for the site blog and cannot log in to the site.
  • "BLOCKED": Member is blocked and cannot log in to the site.
  • "UNKNOWN": Insufficient permissions to get the status.
contactId
string

Contact ID.

privacyStatus
string

Member privacy status.

One of:

  • "PUBLIC": Member is visible to everyone.
  • "PRIVATE": Member is hidden from site visitors and other site members. Member is returned only to site contributors and apps with the appropriate permissions.
  • "UNKNOWN": Insufficient permissions to get the status.
activityStatus
string

Member activity status.

One of:

  • "ACTIVE": Member can write forum posts and blog comments.
  • "MUTED": Member cannot write forum posts or blog comments.
  • "UNKNOWN": Insufficient permissions to get the status.
_createdDate
Date

Date and time when the member was created.

_updatedDate
Date

Date and time when the member was updated.

lastLoginDate
Date

Date and time when the member last logged in to the site.

contactDetails
ContactDetails

Member's contact information. Contact information is stored in the Contact List.

profile
Profile

Profile display info.

Was this helpful?

Delete a member's addresses

Copy Code
1import { members } from 'wix-members-backend';
2
3// Sample id value:
4// 'f32cbc51-a331-442b-86c2-2c664613e8b9'
5
6export function myDeleteAddressesFunction(id) {
7 return members.deleteMemberAddresses(id)
8 .then((updatedMember) => {
9 const addresses = updatedMember.contactDetails.addresses;
10 return updatedMember;
11 })
12 .catch((error) => {
13 console.error(error);
14 })
15}
16
17/* Promise resolves to:
18 * {
19 * "_id": "f32cbc51-a331-442b-86c2-2c664613e8b9",
20 * "_createdDate": "2021-08-02T23:14:42.000Z",
21 * "_updatedDate": "2021-08-02T23:14:58.345Z",
22 * "lastLoginDate": "2021-08-02T23:17:29.000Z",
23 * "contactId": "f32cbc51-a331-442b-86c2-2c664613e8b9",
24 * "loginEmail": "claude.morales@example.com",
25 * "status": "APPROVED",
26 * "activityStatus": "ACTIVE",
27 * "privacyStatus": "PUBLIC",
28 * "contactDetails": {
29 * "firstName": "Claude",
30 * "lastName": "Morales",
31 * "phones": [
32 * "0747-769-460"
33 * ],
34 * "emails": [
35 * "claude.morales@example.com"
36 * ],
37 * "addresses": [],
38 * "customFields": {}
39 * },
40 * "profile": {
41 * "nickname": "Claude Morales",
42 * "slug": "claudemorales"
43 * }
44 * }
45 */