abmp-npm 1.8.27 → 1.8.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  const { contacts } = require('@wix/crm');
2
+ const { auth } = require('@wix/essentials');
2
3
 
3
4
  const { COLLECTIONS } = require('../public/consts');
4
5
 
@@ -13,6 +14,8 @@ const {
13
14
  urlExists,
14
15
  } = require('./utils');
15
16
 
17
+ const elevatedUpdateContact = auth.elevate(contacts.updateContact);
18
+
16
19
  /**
17
20
  * Retrieves member data by member ID
18
21
  * @param {string} memberId - The member ID to search for
@@ -145,10 +148,11 @@ async function updateContactInfo(contactId, updateInfoCallback, operationName) {
145
148
 
146
149
  try {
147
150
  const contact = await contacts.getContact(contactId);
151
+ console.log('contact from updateContactInfo', contact);
148
152
  const currentInfo = contact.info;
149
153
  const updatedInfo = updateInfoCallback(currentInfo);
150
154
 
151
- await contacts.updateContact(contactId, { info: updatedInfo });
155
+ await elevatedUpdateContact(contactId, { info: updatedInfo });
152
156
  } catch (error) {
153
157
  console.error(`Error in ${operationName}:`, error);
154
158
  throw new Error(`Failed to ${operationName}: ${error.message}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "abmp-npm",
3
- "version": "1.8.27",
3
+ "version": "1.8.28",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",