@autofleet/sadot 0.13.5 → 0.13.6-beta.1
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/utils/init.js +2 -4
- package/package.json +2 -2
- package/src/utils/init.ts +2 -3
package/dist/utils/init.js
CHANGED
|
@@ -73,9 +73,7 @@ exports.removeHooks = removeHooks;
|
|
|
73
73
|
/**
|
|
74
74
|
* Necessary associations for the {@link customFieldsFilterScope} scope
|
|
75
75
|
*/
|
|
76
|
-
const addAssociations = (model, modelName
|
|
77
|
-
if (options?.useCustomFieldsEntries)
|
|
78
|
-
return;
|
|
76
|
+
const addAssociations = (model, modelName) => {
|
|
79
77
|
model.hasMany(models_1.CustomFieldValue, { foreignKey: 'modelId', as: 'customFieldValue' });
|
|
80
78
|
// TBC: maybe can be removed
|
|
81
79
|
models_1.CustomFieldValue.belongsTo(model, { foreignKey: 'modelId', as: modelName });
|
|
@@ -92,7 +90,7 @@ const addScopes = (models, getModel, options = { useCustomFieldsEntries: false }
|
|
|
92
90
|
return;
|
|
93
91
|
}
|
|
94
92
|
// Necessary associations for the filtering scope
|
|
95
|
-
addAssociations(model, name
|
|
93
|
+
addAssociations(model, name);
|
|
96
94
|
// Add filter scope
|
|
97
95
|
model.addScope(CUSTOM_FIELDS_FILTER_SCOPE, (0, scopes_1.customFieldsFilterScope)(name, options));
|
|
98
96
|
model.addScope(custom_fields_1.CUSTOM_FIELDS_SORT_SCOPE, (0, filter_1.customFieldsSortScope)(name, options));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autofleet/sadot",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.6-beta.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"typescript": "^5.3.3"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"@autofleet/errors": "^3",
|
|
63
|
+
"@autofleet/errors": "^3.0.0-0",
|
|
64
64
|
"@autofleet/logger": "^4",
|
|
65
65
|
"@autofleet/node-common": "^4",
|
|
66
66
|
"@autofleet/sheilta": "^2",
|
package/src/utils/init.ts
CHANGED
|
@@ -84,8 +84,7 @@ export const removeHooks = (models: Models[], getModel: ModelFetcher): void => {
|
|
|
84
84
|
/**
|
|
85
85
|
* Necessary associations for the {@link customFieldsFilterScope} scope
|
|
86
86
|
*/
|
|
87
|
-
const addAssociations = (model: ModelCtor, modelName: string
|
|
88
|
-
if (options?.useCustomFieldsEntries) return;
|
|
87
|
+
const addAssociations = (model: ModelCtor, modelName: string): void => {
|
|
89
88
|
model.hasMany(CustomFieldValue, { foreignKey: 'modelId', as: 'customFieldValue' });
|
|
90
89
|
// TBC: maybe can be removed
|
|
91
90
|
CustomFieldValue.belongsTo(model, { foreignKey: 'modelId', as: modelName });
|
|
@@ -103,7 +102,7 @@ export const addScopes = (models: Models[], getModel: ModelFetcher, options: Pic
|
|
|
103
102
|
return;
|
|
104
103
|
}
|
|
105
104
|
// Necessary associations for the filtering scope
|
|
106
|
-
addAssociations(model, name
|
|
105
|
+
addAssociations(model, name);
|
|
107
106
|
// Add filter scope
|
|
108
107
|
model.addScope(CUSTOM_FIELDS_FILTER_SCOPE, customFieldsFilterScope(name, options));
|
|
109
108
|
model.addScope(CUSTOM_FIELDS_SORT_SCOPE, customFieldsSortScope(name, options));
|