@xuda.io/account_module 1.2.220 → 1.2.222
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 -6
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1162,16 +1162,13 @@ export const delete_contact = async function (req) {
|
|
|
1162
1162
|
|
|
1163
1163
|
export const add_contact = async function (req, job_id, headers) {
|
|
1164
1164
|
try {
|
|
1165
|
+
const { uid, email, name, stat, contact_uid, req_id, profile_picture, context } = req;
|
|
1166
|
+
const contact_ret = await db_module.get_couch_view_raw('xuda_contacts', 'contacts_by_email_address', { key: [uid, email] });
|
|
1167
|
+
|
|
1165
1168
|
if (contact_ret.rows.length) {
|
|
1166
1169
|
throw new Error('contact already exist active or deleted');
|
|
1167
1170
|
}
|
|
1168
|
-
} catch (err) {
|
|
1169
|
-
return { code: -1, data: err.message };
|
|
1170
|
-
}
|
|
1171
|
-
const { uid, email, name, stat, contact_uid, req_id, profile_picture, context } = req;
|
|
1172
|
-
const contact_ret = await db_module.get_couch_view_raw('xuda_contacts', 'contacts_by_email_address', { key: [uid, email] });
|
|
1173
1171
|
|
|
1174
|
-
if (!contact_ret.rows.length) {
|
|
1175
1172
|
const doc = {
|
|
1176
1173
|
_id: await _common.xuda_get_uuid('contact'),
|
|
1177
1174
|
email: [email],
|
|
@@ -1197,6 +1194,8 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
1197
1194
|
ai_module.update_thumbnail('contact', doc, app_id, uid, job_id, headers, 'xuda_contacts');
|
|
1198
1195
|
|
|
1199
1196
|
return ret;
|
|
1197
|
+
} catch (err) {
|
|
1198
|
+
return { code: -1, data: err.message };
|
|
1200
1199
|
}
|
|
1201
1200
|
};
|
|
1202
1201
|
export const update_contact = async function (req) {
|