Browse Source

fix: change from boolean to number

pull/2558/head
Wing-Kam Wong 2 years ago
parent
commit
bb190e2b2c
  1. 6
      packages/nocodb/src/lib/meta/helpers/PagedResponse.ts

6
packages/nocodb/src/lib/meta/helpers/PagedResponse.ts

@ -7,15 +7,15 @@ export class PagedResponseImpl<T> {
limit = 25, limit = 25,
offset = 0, offset = 0,
count = null, count = null,
shuffle = false, shuffle = 0,
}: { }: {
limit?: number; limit?: number;
offset?: number; offset?: number;
count?: number; count?: number;
shuffle?: boolean; shuffle?: number;
} = {} } = {}
) { ) {
if (shuffle) { if (+shuffle) {
for (let i = list.length - 1; i > 0; i--) { for (let i = list.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1)); const j = Math.floor(Math.random() * (i + 1));
[list[i], list[j]] = [list[j], list[i]]; [list[i], list[j]] = [list[j], list[i]];

Loading…
Cancel
Save