@autofleet/sadot 0.7.0 → 0.7.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/scopes/filter.js +4 -1
- package/package.json +1 -1
- package/src/scopes/filter.ts +4 -1
package/dist/scopes/filter.js
CHANGED
|
@@ -110,7 +110,10 @@ const customFieldsSortScope = (name) => ({ replacementsMap, scopeValue: sort })
|
|
|
110
110
|
`), randomStr,
|
|
111
111
|
]);
|
|
112
112
|
});
|
|
113
|
-
const orders = Object.entries(sort).map(([,
|
|
113
|
+
const orders = Object.entries(sort).map(([, sortObject]) => {
|
|
114
|
+
const direction = typeof sortObject === 'string' ? sortObject : Object.values(sortObject)[0];
|
|
115
|
+
return sequelize_typescript_1.Sequelize.literal(`"${randomStr}" ${direction || 'ASC'}`);
|
|
116
|
+
});
|
|
114
117
|
return {
|
|
115
118
|
attributes: {
|
|
116
119
|
include: includes,
|
package/package.json
CHANGED
package/src/scopes/filter.ts
CHANGED
|
@@ -158,7 +158,10 @@ export const customFieldsSortScope = (
|
|
|
158
158
|
]);
|
|
159
159
|
});
|
|
160
160
|
|
|
161
|
-
const orders = Object.entries(sort).map(([,
|
|
161
|
+
const orders = Object.entries(sort).map(([, sortObject]) => {
|
|
162
|
+
const direction = typeof sortObject === 'string' ? sortObject : Object.values(sortObject)[0];
|
|
163
|
+
return Sequelize.literal(`"${randomStr}" ${direction || 'ASC'}`);
|
|
164
|
+
});
|
|
162
165
|
return {
|
|
163
166
|
attributes: {
|
|
164
167
|
include: includes,
|