dce-reactkit 3.9.3 → 3.9.4-beta-logreviewer.1
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/dist/cjs/index.js +26 -10
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +26 -10
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/LogReviewer.tsx +17 -4
- package/src/server/initServer.ts +11 -5
package/package.json
CHANGED
|
@@ -959,10 +959,23 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
959
959
|
const { year, month } = toLoad[i];
|
|
960
960
|
|
|
961
961
|
// Load
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
962
|
+
let logs: Log[] = [];
|
|
963
|
+
let pageNumber = 1;
|
|
964
|
+
let hasAnotherPage = true;
|
|
965
|
+
|
|
966
|
+
while (hasAnotherPage) {
|
|
967
|
+
const response = await visitServerEndpoint({
|
|
968
|
+
path: `${LOG_REVIEW_ROUTE_PATH_PREFIX}/years/${year}/months/${month}`,
|
|
969
|
+
method: 'GET',
|
|
970
|
+
params: {
|
|
971
|
+
pageNumber,
|
|
972
|
+
},
|
|
973
|
+
});
|
|
974
|
+
|
|
975
|
+
logs = logs.concat(response.items);
|
|
976
|
+
hasAnotherPage = response.hasAnotherPage;
|
|
977
|
+
pageNumber += 1;
|
|
978
|
+
}
|
|
966
979
|
|
|
967
980
|
// Add to map
|
|
968
981
|
if (!logMap[year]) {
|
package/src/server/initServer.ts
CHANGED
|
@@ -246,12 +246,14 @@ const initServer = (
|
|
|
246
246
|
paramTypes: {
|
|
247
247
|
year: ParamType.Int,
|
|
248
248
|
month: ParamType.Int,
|
|
249
|
+
pageNumber: ParamType.Int,
|
|
249
250
|
},
|
|
250
251
|
handler: async ({ params }) => {
|
|
251
252
|
// Get user info
|
|
252
253
|
const {
|
|
253
254
|
year,
|
|
254
255
|
month,
|
|
256
|
+
pageNumber,
|
|
255
257
|
userId,
|
|
256
258
|
isAdmin,
|
|
257
259
|
} = params;
|
|
@@ -266,13 +268,17 @@ const initServer = (
|
|
|
266
268
|
}
|
|
267
269
|
|
|
268
270
|
// Query for logs
|
|
269
|
-
const
|
|
270
|
-
|
|
271
|
-
|
|
271
|
+
const response = await _logCollection.findPaged({
|
|
272
|
+
query: {
|
|
273
|
+
year,
|
|
274
|
+
month,
|
|
275
|
+
},
|
|
276
|
+
perPage: 1000,
|
|
277
|
+
pageNumber,
|
|
272
278
|
});
|
|
273
279
|
|
|
274
|
-
// Return
|
|
275
|
-
return
|
|
280
|
+
// Return response
|
|
281
|
+
return response;
|
|
276
282
|
},
|
|
277
283
|
}),
|
|
278
284
|
);
|