@opengis/fastify-table 1.0.80 → 1.0.81
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/Changelog.md +1 -1
- package/package.json +1 -1
- package/table/controllers/data.js +3 -2
package/Changelog.md
CHANGED
package/package.json
CHANGED
|
@@ -36,8 +36,9 @@ export default async function dataAPI(req) {
|
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
const fData = query.filter ? await getFilterSQL({
|
|
39
|
+
const fData = query.filter || query.search ? await getFilterSQL({
|
|
40
40
|
filter: query.filter,
|
|
41
|
+
search: query.search,
|
|
41
42
|
table: params.table,
|
|
42
43
|
json: 1,
|
|
43
44
|
}) : {};
|
|
@@ -64,7 +65,7 @@ export default async function dataAPI(req) {
|
|
|
64
65
|
|
|
65
66
|
const { rows } = await pg.query(q, (opt?.id || params.id ? [opt?.id || params.id] : null) || (query.key && loadTable.key ? [query.key] : []));
|
|
66
67
|
|
|
67
|
-
const total = keyQuery || opt?.id || params.id ? rows.length : await pg.queryCache(`select count(*) from ${table} t where ${where.join(' and ') || 'true'}`).then((el) => el?.rows[0]?.count);
|
|
68
|
+
const total = keyQuery || opt?.id || params.id ? rows.length : await pg.queryCache(`select count(*) from ${table} t ${sqlTable} where ${where.join(' and ') || 'true'}`).then((el) => el?.rows[0]?.count);
|
|
68
69
|
|
|
69
70
|
await metaFormat({ rows, table: params.table });
|
|
70
71
|
const res = {
|