@simitgroup/simpleapp-generator 2.0.2-f-alpha → 2.0.2-g-alpha

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/ReleaseNote.md CHANGED
@@ -1,3 +1,8 @@
1
+ [2.0.2g-alpha]
2
+
3
+ 1. fix search no header return pagination
4
+
5
+
1
6
  [2.0.2f-alpha]
2
7
 
3
8
  1. fix mini-app search condition
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simitgroup/simpleapp-generator",
3
- "version": "2.0.2f-alpha",
3
+ "version": "2.0.2g-alpha",
4
4
  "description": "frontend nuxtjs and backend nests code generator using jsonschema",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -51,16 +51,13 @@ export class SimpleAppController<TService extends ServiceType, TApiSchema> {
51
51
  return this.service.fullTextSearch(appuser, body);
52
52
  }
53
53
 
54
- async _search(appuser: UserContext, searchObject: SearchBody, res?: Response) {
55
- const items = await this.service.searchWithPageInfo(
56
- appuser,
57
- searchObject['filter'],
58
- searchObject['fields'],
59
- searchObject['sorts'],
60
- searchObject['lookup'],
61
- searchObject['pagination'],
62
- );
63
-
54
+ async _search(appuser: UserContext, searchObject: SearchBody, res?: Response) {
55
+ //return this.service.search(appuser, searchObject['filter'], searchObject['fields'], searchObject['sorts'], searchObject['lookup']);
56
+ const items = await this.service.searchWithPageInfo(appuser, searchObject['filter'], searchObject['fields'], searchObject['sorts'], searchObject['lookup'], searchObject['pagination']);
57
+ const total = await this.service.getTotalCount(appuser, searchObject['filter'] || {});
58
+ const pageSize = searchObject['pagination']?.pageSize || items.length;
59
+ const pageNo = searchObject['pagination']?.pageNo || 0;
60
+ this.service.setPaginationHeaders(res, total, { pageSize, pageNo });
64
61
  return items;
65
62
  }
66
63