@xuda.io/account_module 1.2.1267 → 1.2.1269
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 +6 -6
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2332,12 +2332,12 @@ export const get_contacts = async function (req) {
|
|
|
2332
2332
|
};
|
|
2333
2333
|
|
|
2334
2334
|
export const archive_contact = async function (req) {
|
|
2335
|
-
const { contact_id } = req;
|
|
2335
|
+
const { uid, contact_id } = req;
|
|
2336
2336
|
try {
|
|
2337
2337
|
const team_module = await import(`${module_path}/team_module/index.mjs`);
|
|
2338
2338
|
await team_module.validate_share_exist(uid, 'contact', contact_id);
|
|
2339
2339
|
|
|
2340
|
-
var contact_doc = await
|
|
2340
|
+
var contact_doc = await get_contact(uid, contact_id);
|
|
2341
2341
|
|
|
2342
2342
|
if (contact_doc.uid !== uid && contact_doc?.account_profile_info?.uid !== uid) {
|
|
2343
2343
|
throw new Error('Operation not allowed');
|
|
@@ -2359,9 +2359,9 @@ export const archive_contact = async function (req) {
|
|
|
2359
2359
|
};
|
|
2360
2360
|
|
|
2361
2361
|
export const delete_contact = async function (req, job_id, headers) {
|
|
2362
|
-
const { contact_id } = req;
|
|
2362
|
+
const { uid, contact_id } = req;
|
|
2363
2363
|
try {
|
|
2364
|
-
var contact_doc = await
|
|
2364
|
+
var contact_doc = await get_contact(uid, contact_id);
|
|
2365
2365
|
if (contact_doc.stat !== 5) {
|
|
2366
2366
|
throw new Error('A document can only be deleted after it has been archived');
|
|
2367
2367
|
}
|
|
@@ -2382,9 +2382,9 @@ export const delete_contact = async function (req, job_id, headers) {
|
|
|
2382
2382
|
};
|
|
2383
2383
|
|
|
2384
2384
|
export const unarchive_contact = async function (req) {
|
|
2385
|
-
const { contact_id } = req;
|
|
2385
|
+
const { uid, contact_id } = req;
|
|
2386
2386
|
try {
|
|
2387
|
-
var contact_doc = await
|
|
2387
|
+
var contact_doc = await get_contact(uid, contact_id);
|
|
2388
2388
|
|
|
2389
2389
|
if (contact_doc.stat !== 5) {
|
|
2390
2390
|
throw new Error('contact is not archived');
|