@xuda.io/account_module 1.2.1098 → 1.2.1100
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 +8 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2709,9 +2709,16 @@ export const get_account_profiles = async function (req) {
|
|
|
2709
2709
|
};
|
|
2710
2710
|
|
|
2711
2711
|
export const archive_account_profile = async function (req) {
|
|
2712
|
-
const { profile_id } = req;
|
|
2712
|
+
const { uid, profile_id } = req;
|
|
2713
2713
|
try {
|
|
2714
|
+
await validate_share_exist(uid, 'profile', profile_id);
|
|
2715
|
+
|
|
2714
2716
|
var account_profile_doc = await db_module.get_couch_doc_native('xuda_accounts', profile_id);
|
|
2717
|
+
|
|
2718
|
+
if (account_profile_doc.reserve) {
|
|
2719
|
+
throw new Error('reserve');
|
|
2720
|
+
}
|
|
2721
|
+
|
|
2715
2722
|
account_profile_doc.stat = 5;
|
|
2716
2723
|
account_profile_doc.stat_ts = Date.now();
|
|
2717
2724
|
account_profile_doc.stat_reason = 'archived by the user';
|