@xuda.io/account_module 1.2.1108 → 1.2.1111

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 -2
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1735,7 +1735,9 @@ export const delete_contact = async function (req, job_id, headers) {
1735
1735
  const { contact_id } = req;
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');
1740
+ }
1739
1741
  contact_doc.stat = 4;
1740
1742
  contact_doc.stat_ts = Date.now();
1741
1743
  contact_doc.stat_reason = 'deleted by the user';
@@ -2743,7 +2745,9 @@ export const delete_account_profile = async function (req, job_id, headers) {
2743
2745
  const { profile_id } = req;
2744
2746
  try {
2745
2747
  var account_profile_doc = await db_module.get_couch_doc_native('xuda_accounts', profile_id);
2746
-
2748
+ if (account_profile_doc.stat !== 5) {
2749
+ throw new Error('document must be archived before deleting');
2750
+ }
2747
2751
  account_profile_doc.stat = 4;
2748
2752
  account_profile_doc.stat_ts = Date.now();
2749
2753
  account_profile_doc.stat_reason = 'deleted by the user';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1108",
3
+ "version": "1.2.1111",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {