Skip to content

Commit 5727418

Browse files
committed
Fix errors
1 parent 2a40e89 commit 5727418

2 files changed

Lines changed: 4 additions & 11 deletions

File tree

src/utils/PaginationUtil.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ export namespace PaginationUtil {
5050
async (input: IPage.IRequest): Promise<IPage<IProps.DeduceOutput<T>>> => {
5151
input.limit ??= 100;
5252

53-
const records: number = await props.schema.count({
54-
where: spec.where,
55-
});
53+
const records: number = await props.schema.count({ where: spec.where });
5654
const pages: number =
5755
input.limit !== 0 ? Math.ceil(records / input.limit) : 1;
5856
input.page = input.page ? Math.max(1, Math.min(input.page, pages)) : 1;
@@ -65,15 +63,10 @@ export namespace PaginationUtil {
6563
orderBy: spec.orderBy,
6664
});
6765
return {
68-
data: await ArrayUtil.asyncMap(data)(async (elem) =>
66+
data: await ArrayUtil.asyncMap(data, async (elem) =>
6967
props.transform(elem),
7068
),
71-
pagination: {
72-
records,
73-
pages,
74-
current: input.page,
75-
limit: input.limit,
76-
},
69+
pagination: { records, pages, current: input.page, limit: input.limit },
7770
};
7871
};
7972

test/manual/update.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ async function main(): Promise<void> {
3333

3434
try {
3535
await Promise.all(
36-
ArrayUtil.repeat(600)(async (i) => {
36+
ArrayUtil.repeat(600, async (i) => {
3737
await sleep_for(i * 10);
3838
await api.functional.monitors.system.get(connection);
3939
}),

0 commit comments

Comments
 (0)