abmp-npm 1.8.28 → 1.8.30

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.
@@ -14,6 +14,7 @@ const {
14
14
  urlExists,
15
15
  } = require('./utils');
16
16
 
17
+ const elevatedGetContact = auth.elevate(contacts.getContact);
17
18
  const elevatedUpdateContact = auth.elevate(contacts.updateContact);
18
19
 
19
20
  /**
@@ -147,12 +148,12 @@ async function updateContactInfo(contactId, updateInfoCallback, operationName) {
147
148
  }
148
149
 
149
150
  try {
150
- const contact = await contacts.getContact(contactId);
151
+ const contact = await elevatedGetContact(contactId);
151
152
  console.log('contact from updateContactInfo', contact);
152
153
  const currentInfo = contact.info;
153
154
  const updatedInfo = updateInfoCallback(currentInfo);
154
155
 
155
- await elevatedUpdateContact(contactId, { info: updatedInfo });
156
+ await elevatedUpdateContact(contactId, { info: updatedInfo }, contact.revision);
156
157
  } catch (error) {
157
158
  console.error(`Error in ${operationName}:`, error);
158
159
  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.28",
3
+ "version": "1.8.30",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",