@tthr/vue 0.0.25 → 0.0.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.
@@ -123,7 +123,18 @@ function createDatabaseProxy(apiKey, url, projectId) {
123
123
  if (options?.where) args.where = options.where;
124
124
  if (options?.limit) args.limit = options.limit;
125
125
  if (options?.offset) args.offset = options.offset;
126
- if (options?.orderBy) args.orderBy = options.orderBy;
126
+ // Handle orderBy as either a string or an object { column: 'asc'|'desc' }
127
+ if (options?.orderBy) {
128
+ if (typeof options.orderBy === 'string') {
129
+ args.orderBy = options.orderBy;
130
+ } else if (typeof options.orderBy === 'object') {
131
+ const [column, dir] = Object.entries(options.orderBy)[0] || [];
132
+ if (column) {
133
+ args.orderBy = column;
134
+ args.orderDir = dir?.toUpperCase?.() || 'ASC';
135
+ }
136
+ }
137
+ }
127
138
  if (options?.orderDir) args.orderDir = options.orderDir;
128
139
  return makeRequest('list', args);
129
140
  },
@@ -123,7 +123,18 @@ function createDatabaseProxy(apiKey, url, projectId) {
123
123
  if (options?.where) args.where = options.where;
124
124
  if (options?.limit) args.limit = options.limit;
125
125
  if (options?.offset) args.offset = options.offset;
126
- if (options?.orderBy) args.orderBy = options.orderBy;
126
+ // Handle orderBy as either a string or an object { column: 'asc'|'desc' }
127
+ if (options?.orderBy) {
128
+ if (typeof options.orderBy === 'string') {
129
+ args.orderBy = options.orderBy;
130
+ } else if (typeof options.orderBy === 'object') {
131
+ const [column, dir] = Object.entries(options.orderBy)[0] || [];
132
+ if (column) {
133
+ args.orderBy = column;
134
+ args.orderDir = dir?.toUpperCase?.() || 'ASC';
135
+ }
136
+ }
137
+ }
127
138
  if (options?.orderDir) args.orderDir = options.orderDir;
128
139
  return makeRequest('list', args);
129
140
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tthr/vue",
3
- "version": "0.0.25",
3
+ "version": "0.0.26",
4
4
  "description": "Tether Vue/Nuxt SDK",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",