not-node 6.5.56 → 6.5.58
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/package.json
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const Validators = require("not-node/src/core/validators");
|
|
2
|
+
const ObjectId = require("mongoose").SchemaTypes.ObjectId;
|
|
3
|
+
|
|
4
|
+
module.exports = {
|
|
5
|
+
ui: {
|
|
6
|
+
component: "UIHidden",
|
|
7
|
+
placeholder: "_ids",
|
|
8
|
+
label: "_ids",
|
|
9
|
+
readonly: true,
|
|
10
|
+
},
|
|
11
|
+
model: {
|
|
12
|
+
type: ObjectId,
|
|
13
|
+
safe: require("not-node/src/core/safety.protocols").systemManageable,
|
|
14
|
+
validate: Validators.ObjectId.list,
|
|
15
|
+
},
|
|
16
|
+
};
|
|
@@ -7,6 +7,7 @@ module.exports = {
|
|
|
7
7
|
targetID: require("./ID.js"),
|
|
8
8
|
_id: require("./targetId.js"),
|
|
9
9
|
targetId: require("./targetId.js"),
|
|
10
|
+
targetIds: require("./targetIds.js"),
|
|
10
11
|
activeUser: require("./activeUser.js"),
|
|
11
12
|
activeUserId: require("./activeUserId.js"),
|
|
12
13
|
ip: require("./ip.js"),
|
|
@@ -13,7 +13,12 @@ module.exports = class StandartQueriesBeforeAction {
|
|
|
13
13
|
if (query.search) {
|
|
14
14
|
query.search = notFilter.filter.modifyRules(
|
|
15
15
|
query.search,
|
|
16
|
-
query.filter
|
|
16
|
+
query.filter,
|
|
17
|
+
(filter, property, rule)=>{
|
|
18
|
+
if(!Object.hasOwn(filter, property)){
|
|
19
|
+
filter[property] = rule;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
17
22
|
);
|
|
18
23
|
}
|
|
19
24
|
}
|
package/src/model/default.js
CHANGED
|
@@ -431,7 +431,7 @@ function getID() {
|
|
|
431
431
|
* @param {object} [data=undefined] if we want update some fields
|
|
432
432
|
* @return {number} ID
|
|
433
433
|
*/
|
|
434
|
-
function close(data = undefined) {
|
|
434
|
+
function close(data = undefined, saveOptions = {validateBeforeSave: true}) {
|
|
435
435
|
if (this?.schema?.statics?.__versioning) {
|
|
436
436
|
if (data && Object.keys(data)) {
|
|
437
437
|
Object.keys(data).forEach((fieldName) => {
|
|
@@ -440,7 +440,7 @@ function close(data = undefined) {
|
|
|
440
440
|
});
|
|
441
441
|
}
|
|
442
442
|
this.__closed = true;
|
|
443
|
-
return this.save();
|
|
443
|
+
return this.save(saveOptions);
|
|
444
444
|
} else {
|
|
445
445
|
return this.deleteOne({ _id: this._id });
|
|
446
446
|
}
|