@domain.js/main 0.7.10 → 0.7.12
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/dist/deps/rest/utils.js +12 -4
- package/package.json +2 -2
package/dist/deps/rest/utils.js
CHANGED
|
@@ -376,8 +376,11 @@ function Utils(cnf, deps) {
|
|
|
376
376
|
findOptFilter(params, name, where, Model.name);
|
|
377
377
|
});
|
|
378
378
|
if (!params._showDeleted) {
|
|
379
|
-
|
|
379
|
+
const rawAttributes = Model.getAttributes();
|
|
380
|
+
if ("isDeleted" in rawAttributes)
|
|
380
381
|
where.isDeleted = "no";
|
|
382
|
+
if ("deletedAt" in rawAttributes)
|
|
383
|
+
where.deletedAt = null;
|
|
381
384
|
}
|
|
382
385
|
// 将搜索条件添加到主条件上
|
|
383
386
|
const searchOptRes = searchOpt(Model, params._searchs, params.q);
|
|
@@ -392,10 +395,15 @@ function Utils(cnf, deps) {
|
|
|
392
395
|
_.each(filterAttrs, (name) => {
|
|
393
396
|
findOptFilter(params, `${x.as}.${name}`, includeWhere, x.as, name);
|
|
394
397
|
});
|
|
398
|
+
const rawAttributes = x.model.getAttributes();
|
|
395
399
|
if (!params._showDeleted) {
|
|
396
|
-
if (
|
|
397
|
-
|
|
398
|
-
|
|
400
|
+
if ("isDeleted" in rawAttributes) {
|
|
401
|
+
includeWhere[sequelize_1.Op.or] = [{ isDeleted: "no" }];
|
|
402
|
+
if (x.required === false)
|
|
403
|
+
includeWhere[sequelize_1.Op.or].push({ id: null });
|
|
404
|
+
}
|
|
405
|
+
if ("deletedAt" in rawAttributes) {
|
|
406
|
+
includeWhere[sequelize_1.Op.or] = [{ deletedAt: null }];
|
|
399
407
|
if (x.required === false)
|
|
400
408
|
includeWhere[sequelize_1.Op.or].push({ id: null });
|
|
401
409
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domain.js/main",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.12",
|
|
4
4
|
"description": "DDD framework",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"mysql2": "^2.3.3",
|
|
78
78
|
"restify": "^11.1.0",
|
|
79
79
|
"restify-errors": "^8.0.2",
|
|
80
|
-
"sequelize": "^6.37.
|
|
80
|
+
"sequelize": "^6.37.3",
|
|
81
81
|
"socket.io": "^4.4.1",
|
|
82
82
|
"type-fest": "^2.8.0",
|
|
83
83
|
"uuid": "^8.3.2",
|