Skip to content

Commit 35187f4

Browse files
authored
Merge branch 'master' into issue-18424
2 parents 8cc85bc + f5742b2 commit 35187f4

File tree

139 files changed

+7130
-1097
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+7130
-1097
lines changed

components/apify/actions/get-dataset-items/get-dataset-items.mjs

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "apify-get-dataset-items",
66
name: "Get Dataset Items",
77
description: "Returns data stored in a dataset. [See the documentation](https://docs.apify.com/api/v2/dataset-items-get)",
8-
version: "0.0.3",
8+
version: "0.0.4",
99
type: "action",
1010
props: {
1111
apify,
@@ -33,48 +33,46 @@ export default {
3333
"omit",
3434
],
3535
},
36-
flatten: {
36+
offset: {
3737
propDefinition: [
3838
apify,
39-
"flatten",
39+
"offset",
4040
],
4141
},
42-
maxResults: {
42+
limit: {
4343
propDefinition: [
4444
apify,
45-
"maxResults",
45+
"limit",
4646
],
4747
},
4848
},
4949
async run({ $ }) {
5050
const params = {
5151
limit: LIMIT,
52-
offset: 0,
52+
offset: this.offset,
5353
clean: this.clean,
54-
fields: this.fields && this.fields.join(),
55-
omit: this.omit && this.omit.join(),
56-
flatten: this.flatten && this.flatten.join(),
54+
fields: this.fields,
55+
omit: this.omit,
5756
};
5857

5958
const results = [];
6059
let total;
6160

6261
do {
63-
const items = await this.apify.listDatasetItems({
64-
$,
62+
const { items } = await this.apify.listDatasetItems({
6563
datasetId: this.datasetId,
6664
params,
6765
});
6866
results.push(...items);
69-
if (results.length >= this.maxResults) {
67+
if (results.length >= this.limit) {
7068
break;
7169
}
7270
total = items?.length;
7371
params.offset += LIMIT;
7472
} while (total);
7573

76-
if (results.length > this.maxResults) {
77-
results.length = this.maxResults;
74+
if (results.length > this.limit) {
75+
results.length = this.limit;
7876
}
7977

8078
if (results.length > 0) {

0 commit comments

Comments
 (0)