not-node 6.3.29 → 6.3.31
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 +1 -1
- package/src/form/form.js +2 -2
- package/src/generic/logic.js +7 -8
- package/src/model/default.js +5 -1
- package/src/model/versioning.js +1 -1
package/package.json
CHANGED
package/src/form/form.js
CHANGED
|
@@ -186,7 +186,7 @@ class Form {
|
|
|
186
186
|
);
|
|
187
187
|
if (!validationResult.clean) {
|
|
188
188
|
throw new notValidationError(
|
|
189
|
-
"not-
|
|
189
|
+
"not-node:form_validation_error",
|
|
190
190
|
validationResult.getReport(),
|
|
191
191
|
null,
|
|
192
192
|
data
|
|
@@ -305,7 +305,7 @@ class Form {
|
|
|
305
305
|
throw e;
|
|
306
306
|
} else {
|
|
307
307
|
throw new notError(
|
|
308
|
-
"
|
|
308
|
+
"not-node:form_validation_error",
|
|
309
309
|
{
|
|
310
310
|
FORM_NAME: this.#FORM_NAME,
|
|
311
311
|
PROTO_FIELDS: this.#PROTO_FIELDS,
|
package/src/generic/logic.js
CHANGED
|
@@ -4,10 +4,9 @@ const { deleteResponseSuccess } = require("../model/utils.js");
|
|
|
4
4
|
const {
|
|
5
5
|
DBExceptionDocumentIsNotFound,
|
|
6
6
|
DBExceptionDeleteWasNotSuccessful,
|
|
7
|
-
} = require("../exceptions/db.js");
|
|
8
|
-
const {
|
|
9
7
|
DBExceptionDocumentIsNotOwnerByActiveUser,
|
|
10
|
-
} = require("../exceptions/
|
|
8
|
+
} = require("../exceptions/db.js");
|
|
9
|
+
|
|
11
10
|
const isOwnerImported = require("../auth/fields.js").isOwner;
|
|
12
11
|
const { DOCUMENT_OWNER_FIELD_NAME } = require("../auth/const.js");
|
|
13
12
|
const notFilter = require("not-filter");
|
|
@@ -81,7 +80,7 @@ module.exports = ({
|
|
|
81
80
|
checkShouldOwn(data, shouldOwn, identity);
|
|
82
81
|
const res = await getModel().add(data);
|
|
83
82
|
LogAction(action, identity, {
|
|
84
|
-
targetId: res
|
|
83
|
+
targetId: res?._id,
|
|
85
84
|
});
|
|
86
85
|
return res;
|
|
87
86
|
}
|
|
@@ -134,7 +133,7 @@ module.exports = ({
|
|
|
134
133
|
const result = await getModel().update(query, data);
|
|
135
134
|
LogAction(action, identity, {
|
|
136
135
|
targetId,
|
|
137
|
-
version: result
|
|
136
|
+
version: result?.__version,
|
|
138
137
|
});
|
|
139
138
|
return result;
|
|
140
139
|
}
|
|
@@ -185,7 +184,7 @@ module.exports = ({
|
|
|
185
184
|
const result = await getModel().getOne(targetId, populate, query);
|
|
186
185
|
LogAction(action, identity, {
|
|
187
186
|
targetId,
|
|
188
|
-
version: result
|
|
187
|
+
version: result?.__version,
|
|
189
188
|
});
|
|
190
189
|
return result;
|
|
191
190
|
}
|
|
@@ -243,7 +242,7 @@ module.exports = ({
|
|
|
243
242
|
);
|
|
244
243
|
LogAction(action, identity, {
|
|
245
244
|
targetID,
|
|
246
|
-
version: result
|
|
245
|
+
version: result?.__version,
|
|
247
246
|
});
|
|
248
247
|
return result;
|
|
249
248
|
}
|
|
@@ -293,7 +292,7 @@ module.exports = ({
|
|
|
293
292
|
const result = await getModel().getOneRaw(targetId, query);
|
|
294
293
|
LogAction(action, identity, {
|
|
295
294
|
targetId,
|
|
296
|
-
version: result
|
|
295
|
+
version: result?.__version,
|
|
297
296
|
});
|
|
298
297
|
return result;
|
|
299
298
|
}
|
package/src/model/default.js
CHANGED
|
@@ -394,7 +394,11 @@ function close(data = undefined) {
|
|
|
394
394
|
}
|
|
395
395
|
|
|
396
396
|
function saveNewVersion() {
|
|
397
|
-
return routine.update(
|
|
397
|
+
return routine.update(
|
|
398
|
+
this.constructor,
|
|
399
|
+
{ _id: this._id },
|
|
400
|
+
this.toObject({ minimize: false })
|
|
401
|
+
);
|
|
398
402
|
}
|
|
399
403
|
|
|
400
404
|
module.exports.thisMethods = {
|