@opengis/fastify-table 2.0.46 → 2.0.47

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.
@@ -1 +1 @@
1
- {"version":3,"file":"suggest.d.ts","sourceRoot":"","sources":["../../../../../server/routes/table/controllers/suggest.ts"],"names":[],"mappings":"AAsDA,wBAA8B,OAAO,CAAC,GAAG,EAAE,GAAG,gBA8U7C"}
1
+ {"version":3,"file":"suggest.d.ts","sourceRoot":"","sources":["../../../../../server/routes/table/controllers/suggest.ts"],"names":[],"mappings":"AAsDA,wBAA8B,OAAO,CAAC,GAAG,EAAE,GAAG,gBAgV7C"}
@@ -199,7 +199,7 @@ export default async function suggest(req) {
199
199
  ? `unnest(${filterColumn})`
200
200
  : filterColumn} from ${(loadTable?.table || query.token).replace(/'/g, "''")})`
201
201
  : "true";
202
- const sqlSuggest = `with c(id,text) as ( ${meta.original.replace(/{{parent}}/gi, parent)} where ${where} order by 2) select * from c where ${filter} limit ${Math.min(query.limit || meta.limit || limit, limit)}`.replace(/{{uid}}/g, user?.uid || "0");
202
+ const sqlSuggest = `with c(id,text) as ( ${meta.original.replace(/{{parent}}/gi, parent)} where ${where} ${meta.original.includes("order by") ? "" : "order by 2"}) select * from c where ${filter} limit ${Math.min(query.limit || meta.limit || limit, limit)}`.replace(/{{uid}}/g, user?.uid || "0");
203
203
  if (query.sql && (config.local || user?.user_type?.includes?.("admin"))) {
204
204
  return sqlSuggest;
205
205
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/fastify-table",
3
- "version": "2.0.46",
3
+ "version": "2.0.47",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "keywords": [