@xuda.io/account_module 1.2.458 → 1.2.460
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 +35 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1169,6 +1169,36 @@ export const merge_contact = async function (req) {
|
|
|
1169
1169
|
const get_contact_background = function (doc) {
|
|
1170
1170
|
const ret = `linear-gradient(145deg,#60496e8c 0%,#71C4FF44 100%)`;
|
|
1171
1171
|
|
|
1172
|
+
if (doc.pending) {
|
|
1173
|
+
ret = `linear-gradient(145deg, #4f4f4f8c 0%, #0e0f0f44 100%);`;
|
|
1174
|
+
} else {
|
|
1175
|
+
switch (doc.contact_mood) {
|
|
1176
|
+
case -2: {
|
|
1177
|
+
ret = `linear-gradient(145deg, #f60404d8 0%, #7f98e344 100%)`;
|
|
1178
|
+
break;
|
|
1179
|
+
}
|
|
1180
|
+
case -1: {
|
|
1181
|
+
ret = `linear-gradient(145deg, #f6040452 0%, #7f98e344 100%)`;
|
|
1182
|
+
break;
|
|
1183
|
+
}
|
|
1184
|
+
case 1: {
|
|
1185
|
+
ret = `linear-gradient(145deg, #04f61452 0%, #7f98e344 100%)`;
|
|
1186
|
+
break;
|
|
1187
|
+
}
|
|
1188
|
+
case 2: {
|
|
1189
|
+
ret = `linear-gradient(145deg, #30f604c9 0%, #7f98e344 100%)`;
|
|
1190
|
+
break;
|
|
1191
|
+
}
|
|
1192
|
+
default:
|
|
1193
|
+
break;
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
return ret;
|
|
1197
|
+
};
|
|
1198
|
+
|
|
1199
|
+
const get_contact_pattern = function (doc) {
|
|
1200
|
+
const ret = `default-pattern.png`;
|
|
1201
|
+
|
|
1172
1202
|
if (doc.pending) {
|
|
1173
1203
|
ret = `linear-gradient(145deg, #4f4f4f8c 0%, #0e0f0f44 100%);`;
|
|
1174
1204
|
}
|
|
@@ -1198,7 +1228,7 @@ const get_contact_background = function (doc) {
|
|
|
1198
1228
|
};
|
|
1199
1229
|
|
|
1200
1230
|
export const get_contacts = async function (req) {
|
|
1201
|
-
const { uid, name, limit, skip, bookmark, search, with_requests } = req;
|
|
1231
|
+
const { _id, uid, name, limit, skip, bookmark, search, with_requests } = req;
|
|
1202
1232
|
var opt = {
|
|
1203
1233
|
selector: {
|
|
1204
1234
|
docType: 'contact',
|
|
@@ -1220,6 +1250,10 @@ export const get_contacts = async function (req) {
|
|
|
1220
1250
|
limit: limit ? limit : 99999,
|
|
1221
1251
|
};
|
|
1222
1252
|
|
|
1253
|
+
if (_id) {
|
|
1254
|
+
opt.selector._id = _id;
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1223
1257
|
if (typeof name !== 'undefined') {
|
|
1224
1258
|
opt.selector.name = { $regex: `(?i)${name}` };
|
|
1225
1259
|
}
|