@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
package/package.json
CHANGED
|
@@ -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
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
|