@xuda.io/account_module 1.2.1111 → 1.2.1113

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.
Files changed (2) hide show
  1. package/index.mjs +6 -4
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1736,7 +1736,7 @@ export const delete_contact = async function (req, job_id, headers) {
1736
1736
  try {
1737
1737
  var contact_doc = await db_module.get_couch_doc_native('xuda_contacts', contact_id);
1738
1738
  if (contact_doc.stat !== 5) {
1739
- throw new Error('document must be archived before deleting');
1739
+ throw new Error('A document can only be deleted after it has been archived');
1740
1740
  }
1741
1741
  contact_doc.stat = 4;
1742
1742
  contact_doc.stat_ts = Date.now();
@@ -2693,8 +2693,10 @@ export const get_account_profiles = async function (req) {
2693
2693
  let profile_docs = { docs: [], total_docs: profiles.total_docs };
2694
2694
  for await (let doc of profiles.docs) {
2695
2695
  doc = await get_account_profile_info(uid, doc);
2696
-
2697
- profile_docs.docs.push(doc);
2696
+ if (doc.reserve) {
2697
+ } else {
2698
+ profile_docs.docs.push(doc);
2699
+ }
2698
2700
  }
2699
2701
 
2700
2702
  if (!profile_id) {
@@ -2746,7 +2748,7 @@ export const delete_account_profile = async function (req, job_id, headers) {
2746
2748
  try {
2747
2749
  var account_profile_doc = await db_module.get_couch_doc_native('xuda_accounts', profile_id);
2748
2750
  if (account_profile_doc.stat !== 5) {
2749
- throw new Error('document must be archived before deleting');
2751
+ throw new Error('A document can only be deleted after it has been archived');
2750
2752
  }
2751
2753
  account_profile_doc.stat = 4;
2752
2754
  account_profile_doc.stat_ts = Date.now();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1111",
3
+ "version": "1.2.1113",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {