@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.
@@ -110,7 +110,10 @@ const customFieldsSortScope = (name) => ({ replacementsMap, scopeValue: sort })
110
110
  `), randomStr,
111
111
  ]);
112
112
  });
113
- const orders = Object.entries(sort).map(([, value]) => sequelize_typescript_1.Sequelize.literal(`"${randomStr}" ${value}`));
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autofleet/sadot",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -158,7 +158,10 @@ export const customFieldsSortScope = (
158
158
  ]);
159
159
  });
160
160
 
161
- const orders = Object.entries(sort).map(([, value]) => Sequelize.literal(`"${randomStr}" ${value}`));
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,