@autofleet/shtinker 1.1.7-beta5 → 1.1.7
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/audit-logger.js +2 -2
- package/package.json +1 -2
- package/src/audit-logger.ts +4 -4
package/dist/audit-logger.js
CHANGED
|
@@ -39,8 +39,8 @@ const getChangedFieldsRows = (instance, options) => {
|
|
|
39
39
|
// When bulk updating in sequelize using the "returning" option, the instance.changed() stops working.
|
|
40
40
|
// It's a known issue with sequelize.
|
|
41
41
|
const changedFields = options.returning ? options.fields : instance.changed();
|
|
42
|
-
//Filter customFields - we'll handle them later
|
|
43
|
-
const filteredChangedFields = filterOutEmptyFields(changedFields.filter(
|
|
42
|
+
// Filter customFields - we'll handle them later
|
|
43
|
+
const filteredChangedFields = filterOutEmptyFields(changedFields.filter((field) => field !== CUSTOM_FIELDS_PROPERTY), instance);
|
|
44
44
|
return filteredChangedFields.map((property) => ({
|
|
45
45
|
property,
|
|
46
46
|
previousValue: instance.previous(property),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autofleet/shtinker",
|
|
3
|
-
"version": "1.1.7
|
|
3
|
+
"version": "1.1.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
"@autofleet/errors": "^1.2.2",
|
|
16
16
|
"@autofleet/logger": "^4.0.6",
|
|
17
17
|
"@autofleet/network": "^1.4.7",
|
|
18
|
-
"@autofleet/netwrok": "^1.0.0",
|
|
19
18
|
"@autofleet/rabbit": "^3.2.18",
|
|
20
19
|
"@autofleet/zehut": "^3.0.10",
|
|
21
20
|
"sequelize-typescript": "^2.1.5"
|
package/src/audit-logger.ts
CHANGED
|
@@ -27,14 +27,14 @@ const isEmpty = (field) => {
|
|
|
27
27
|
return false;
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
const filterOutEmptyFields = (fields, instance) => fields.filter((field) => !isEmpty(instance.get(field)) || !isEmpty(instance.previous(field)));
|
|
30
|
+
const filterOutEmptyFields = (fields: string[], instance) => fields.filter((field) => !isEmpty(instance.get(field)) || !isEmpty(instance.previous(field)));
|
|
31
31
|
|
|
32
32
|
const getChangedFieldsRows = (instance, options) => {
|
|
33
33
|
// When bulk updating in sequelize using the "returning" option, the instance.changed() stops working.
|
|
34
34
|
// It's a known issue with sequelize.
|
|
35
|
-
const changedFields = options.returning ? options.fields : instance.changed();
|
|
36
|
-
//Filter customFields - we'll handle them later
|
|
37
|
-
const filteredChangedFields = filterOutEmptyFields(changedFields.filter(
|
|
35
|
+
const changedFields: string[] = options.returning ? options.fields : instance.changed();
|
|
36
|
+
// Filter customFields - we'll handle them later
|
|
37
|
+
const filteredChangedFields = filterOutEmptyFields(changedFields.filter((field) => field !== CUSTOM_FIELDS_PROPERTY), instance);
|
|
38
38
|
return filteredChangedFields.map((property: string) => ({
|
|
39
39
|
property,
|
|
40
40
|
previousValue: instance.previous(property),
|