@xuda.io/account_module 1.2.1202 → 1.2.1204
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 -0
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1746,6 +1746,11 @@ export const archive_contact = async function (req) {
|
|
|
1746
1746
|
await team_module.validate_share_exist(uid, 'contact', contact_id);
|
|
1747
1747
|
|
|
1748
1748
|
var contact_doc = await db_module.get_couch_doc_native('xuda_contacts', contact_id);
|
|
1749
|
+
|
|
1750
|
+
if (contact_doc.uid !== uid && contact_doc?.account_profile_info?.uid !== uid) {
|
|
1751
|
+
throw new Error('Operation not allowed');
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1749
1754
|
contact_doc.stat = 5;
|
|
1750
1755
|
contact_doc.stat_ts = Date.now();
|
|
1751
1756
|
contact_doc.stat_reason = 'archived by the user';
|