@xuda.io/account_module 1.2.857 → 1.2.859
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 +5 -2
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1549,7 +1549,7 @@ const get_user_contact = async function (uid, uid_query) {
|
|
|
1549
1549
|
};
|
|
1550
1550
|
|
|
1551
1551
|
export const get_contacts = async function (req) {
|
|
1552
|
-
const { _id, uid, name, limit, skip, bookmark, search, filter_type = 'all' } = req;
|
|
1552
|
+
const { _id, uid, name, limit, skip, bookmark, search, filter_type = 'all', contact_id } = req;
|
|
1553
1553
|
let { with_requests } = req;
|
|
1554
1554
|
var opt = {
|
|
1555
1555
|
selector: {
|
|
@@ -1579,6 +1579,9 @@ export const get_contacts = async function (req) {
|
|
|
1579
1579
|
if (_id) {
|
|
1580
1580
|
opt.selector._id = _id;
|
|
1581
1581
|
}
|
|
1582
|
+
if (contact_id) {
|
|
1583
|
+
opt.selector._id = contact_id;
|
|
1584
|
+
}
|
|
1582
1585
|
|
|
1583
1586
|
if (typeof name !== 'undefined') {
|
|
1584
1587
|
opt.selector.name = { $regex: `(?i)${name}` };
|
|
@@ -1705,7 +1708,7 @@ export const unarchive_contact = async function (req) {
|
|
|
1705
1708
|
try {
|
|
1706
1709
|
var contact_doc = await db_module.get_couch_doc_native('xuda_contacts', contact_id);
|
|
1707
1710
|
|
|
1708
|
-
if (
|
|
1711
|
+
if (contact_doc.stat !== 5) {
|
|
1709
1712
|
throw new Error('contact is not archived');
|
|
1710
1713
|
}
|
|
1711
1714
|
|