@xuda.io/account_module 1.2.1291 → 1.2.1293
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.
- package/index.mjs +15 -9
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1584,25 +1584,31 @@ export const update_contact = async function (req) {
|
|
|
1584
1584
|
const account_profile_info = await get_active_account_profile_info(uid);
|
|
1585
1585
|
|
|
1586
1586
|
var contact_ret;
|
|
1587
|
-
if (email) {
|
|
1588
|
-
|
|
1589
|
-
} else if (contact_uid) {
|
|
1590
|
-
|
|
1591
|
-
}
|
|
1587
|
+
// if (email) {
|
|
1588
|
+
// contact_ret = await db_module.get_couch_view_raw('xuda_contacts', 'contacts_by_user_email_address', { key: [account_profile_info.uid, email] });
|
|
1589
|
+
// } else if (contact_uid) {
|
|
1590
|
+
// contact_ret = await db_module.get_couch_view_raw('xuda_contacts', 'contacts_by_contact_uid', { key: [account_profile_info.uid, contact_uid] });
|
|
1591
|
+
// }
|
|
1592
1592
|
|
|
1593
1593
|
let opt = {
|
|
1594
1594
|
selector: {
|
|
1595
1595
|
docType: 'contact',
|
|
1596
1596
|
stat: 3,
|
|
1597
|
-
email,
|
|
1598
1597
|
},
|
|
1599
1598
|
limit: 1,
|
|
1600
1599
|
fields: ['_id'],
|
|
1601
1600
|
};
|
|
1602
|
-
const user_contacts = await find_contact_query(account_profile_info.uid, opt);
|
|
1603
1601
|
|
|
1604
|
-
if (
|
|
1605
|
-
|
|
1602
|
+
if (email) {
|
|
1603
|
+
opt.selector.email = email;
|
|
1604
|
+
} else if (contact_uid) {
|
|
1605
|
+
opt.selector.contact_uid = contact_uid;
|
|
1606
|
+
}
|
|
1607
|
+
|
|
1608
|
+
contact_ret = await find_contact_query(account_profile_info.uid, opt);
|
|
1609
|
+
|
|
1610
|
+
if (contact_ret.docs.length) {
|
|
1611
|
+
var doc = contact_ret.docs[0];
|
|
1606
1612
|
if (stat) {
|
|
1607
1613
|
doc.stat = stat;
|
|
1608
1614
|
doc.stat_ts = Date.now();
|