soajs.multitenant 2.1.4 → 2.1.6
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/bl/tenant.js +2 -0
- package/config.js +13 -0
- package/model/mongo/tenant.js +12 -0
- package/package.json +1 -1
package/bl/tenant.js
CHANGED
|
@@ -289,6 +289,8 @@ let bl = {
|
|
|
289
289
|
data.start = inputmaskData.start;
|
|
290
290
|
data.limit = inputmaskData.limit;
|
|
291
291
|
data.id = soajs.tenant.id;
|
|
292
|
+
data.category = inputmaskData.category;
|
|
293
|
+
|
|
292
294
|
modelObj.listConsoleTenants(data, (err, record) => {
|
|
293
295
|
bl.mp.closeModel(soajs, modelObj);
|
|
294
296
|
if (err) {
|
package/config.js
CHANGED
|
@@ -1147,6 +1147,13 @@ module.exports = {
|
|
|
1147
1147
|
"type": "string",
|
|
1148
1148
|
"enum": ["product", "client"]
|
|
1149
1149
|
}
|
|
1150
|
+
},
|
|
1151
|
+
"category": {
|
|
1152
|
+
"source": ['query.category'],
|
|
1153
|
+
"validation": {
|
|
1154
|
+
"type": "string",
|
|
1155
|
+
"enum": ["tenant", "application", "integration"]
|
|
1156
|
+
}
|
|
1150
1157
|
}
|
|
1151
1158
|
},
|
|
1152
1159
|
"/tenant/console": {
|
|
@@ -3264,6 +3271,12 @@ module.exports = {
|
|
|
3264
3271
|
"validation": {
|
|
3265
3272
|
"type": "object"
|
|
3266
3273
|
}
|
|
3274
|
+
},
|
|
3275
|
+
"category": {
|
|
3276
|
+
"source": ['body.category'],
|
|
3277
|
+
"validation": {
|
|
3278
|
+
"type": "string"
|
|
3279
|
+
}
|
|
3267
3280
|
}
|
|
3268
3281
|
},
|
|
3269
3282
|
"/tenant/console/profile": {
|
package/model/mongo/tenant.js
CHANGED
|
@@ -324,6 +324,18 @@ Tenant.prototype.listConsoleTenants = function (data, cb) {
|
|
|
324
324
|
if (data && data.type) {
|
|
325
325
|
condition.$and.push({'type': data.type});
|
|
326
326
|
}
|
|
327
|
+
if (data.category) {
|
|
328
|
+
if (data.category === "tenant") {
|
|
329
|
+
condition.$and.push({
|
|
330
|
+
"$or": [
|
|
331
|
+
{"category": data.category},
|
|
332
|
+
{"category": null}
|
|
333
|
+
]
|
|
334
|
+
});
|
|
335
|
+
} else {
|
|
336
|
+
condition.$and.push({"category": data.category});
|
|
337
|
+
}
|
|
338
|
+
}
|
|
327
339
|
|
|
328
340
|
let find = (condition) => {
|
|
329
341
|
__self.mongoCore.find(colName, condition, options, (error, response) => {
|