@xuda.io/account_module 1.2.1108 → 1.2.1110
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 +3 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2743,7 +2743,9 @@ export const delete_account_profile = async function (req, job_id, headers) {
|
|
|
2743
2743
|
const { profile_id } = req;
|
|
2744
2744
|
try {
|
|
2745
2745
|
var account_profile_doc = await db_module.get_couch_doc_native('xuda_accounts', profile_id);
|
|
2746
|
-
|
|
2746
|
+
if (account_profile_doc.stat !== 5) {
|
|
2747
|
+
throw new Error('document must be archived before deleting');
|
|
2748
|
+
}
|
|
2747
2749
|
account_profile_doc.stat = 4;
|
|
2748
2750
|
account_profile_doc.stat_ts = Date.now();
|
|
2749
2751
|
account_profile_doc.stat_reason = 'deleted by the user';
|