@bedrockio/model 0.2.13 → 0.2.14
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/cjs/soft-delete.js
CHANGED
|
@@ -36,7 +36,11 @@ function applyQueries(schema) {
|
|
|
36
36
|
this.deleted = true;
|
|
37
37
|
this.deletedAt = new Date();
|
|
38
38
|
// @ts-ignore
|
|
39
|
-
return this.save(
|
|
39
|
+
return this.save({
|
|
40
|
+
// Do not validate when soft deleting the data is effectively
|
|
41
|
+
// gone for now, however ensure that we do validate when restoring.
|
|
42
|
+
validateBeforeSave: false
|
|
43
|
+
});
|
|
40
44
|
});
|
|
41
45
|
schema.method('restore', function restore() {
|
|
42
46
|
this.deleted = false;
|
package/package.json
CHANGED
package/src/soft-delete.js
CHANGED
|
@@ -29,7 +29,11 @@ function applyQueries(schema) {
|
|
|
29
29
|
this.deleted = true;
|
|
30
30
|
this.deletedAt = new Date();
|
|
31
31
|
// @ts-ignore
|
|
32
|
-
return this.save(
|
|
32
|
+
return this.save({
|
|
33
|
+
// Do not validate when soft deleting the data is effectively
|
|
34
|
+
// gone for now, however ensure that we do validate when restoring.
|
|
35
|
+
validateBeforeSave: false,
|
|
36
|
+
});
|
|
33
37
|
});
|
|
34
38
|
|
|
35
39
|
schema.method('restore', function restore() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"soft-delete.d.ts","sourceRoot":"","sources":["../src/soft-delete.js"],"names":[],"mappings":"AAKA,mDAIC;
|
|
1
|
+
{"version":3,"file":"soft-delete.d.ts","sourceRoot":"","sources":["../src/soft-delete.js"],"names":[],"mappings":"AAKA,mDAIC;AAwTD,oEAsBC;AAgDD,2DAKC"}
|