@autofleet/shtinker 1.1.6-beta.24 → 1.1.6-beta.26

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.
@@ -37,10 +37,8 @@ const filterOutEmptyFields = (fields, instance) => fields.filter((field) => !isE
37
37
  const getChangedFields = (instance, options) => {
38
38
  // When bulk updating in sequelize using the "returning" option, the instance.changed() stops working.
39
39
  // It's a known issut with sequelize.
40
- if (options.returning) {
41
- return filterOutEmptyFields(options.fields, instance);
42
- }
43
- return instance.changed();
40
+ const changedProperties = options.returning ? options.fields : instance.changed();
41
+ return filterOutEmptyFields(changedProperties, instance);
44
42
  };
45
43
  class AuditLogger {
46
44
  constructor(options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autofleet/shtinker",
3
- "version": "1.1.6-beta.24",
3
+ "version": "1.1.6-beta.26",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -30,10 +30,8 @@ const filterOutEmptyFields = (fields, instance) => fields.filter((field) => !isE
30
30
  const getChangedFields = (instance, options) => {
31
31
  // When bulk updating in sequelize using the "returning" option, the instance.changed() stops working.
32
32
  // It's a known issut with sequelize.
33
- if (options.returning) {
34
- return filterOutEmptyFields(options.fields, instance);
35
- }
36
- return instance.changed();
33
+ const changedProperties = options.returning ? options.fields : instance.changed();
34
+ return filterOutEmptyFields(changedProperties, instance);
37
35
  };
38
36
 
39
37
  class AuditLogger {