mm-share-lib 0.0.24 → 0.0.25

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mm-share-lib",
3
- "version": "0.0.24",
3
+ "version": "0.0.25",
4
4
  "description": "Share the generic service, entity, dto.",
5
5
  "author": "Mesa SOT",
6
6
  "license": "MIT",
@@ -106,9 +106,9 @@ export abstract class ClientService<
106
106
  searchParameters.per_page = searchParameters.per_page ?? 250;
107
107
  options.cacheSearchResultsForSeconds = 1;
108
108
  const response = await this.searchDocument(searchParameters, options);
109
- const { hits = [], found = 0, page = 1 } = response;
109
+ const { hits = [], found = 0, page = 1 } = { ...response };
110
110
  let documents = hits;
111
- const hasNext = hits.length * page < found;
111
+ const hasNext = hits?.length * page < found;
112
112
  if (hasNext) {
113
113
  searchParameters.page = page + 1;
114
114
  documents = await this.getAllRawDocs(searchParameters, options);