From b6f854339866124f08426787821485a9da14a245 Mon Sep 17 00:00:00 2001 From: oleksandravalko Date: Wed, 3 Sep 2025 17:06:43 +0200 Subject: [PATCH] fix(apify-get-dataset-items) 6: change parameters --- .../actions/get-dataset-items/get-dataset-items.mjs | 7 +++---- components/apify/apify.app.mjs | 13 +++++++++++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/components/apify/actions/get-dataset-items/get-dataset-items.mjs b/components/apify/actions/get-dataset-items/get-dataset-items.mjs index 2b6403485579a..d0e6f776f3112 100644 --- a/components/apify/actions/get-dataset-items/get-dataset-items.mjs +++ b/components/apify/actions/get-dataset-items/get-dataset-items.mjs @@ -33,10 +33,10 @@ export default { "omit", ], }, - flatten: { + offset: { propDefinition: [ apify, - "flatten", + "offset", ], }, limit: { @@ -49,11 +49,10 @@ export default { async run({ $ }) { const params = { limit: LIMIT, - offset: 0, + offset: this.offset, clean: this.clean, fields: this.fields && this.fields.join(), omit: this.omit && this.omit.join(), - flatten: this.flatten && this.flatten.join(), }; const results = []; diff --git a/components/apify/apify.app.mjs b/components/apify/apify.app.mjs index cc558cea6e7b7..ed778858141ec 100644 --- a/components/apify/apify.app.mjs +++ b/components/apify/apify.app.mjs @@ -70,11 +70,13 @@ export default { const { items } = await this.listDatasets({ offset: LIMIT * page, limit: LIMIT, + desc: true, + unnamed: true, }); return items?.map(({ - id: value, name: label, + id: value, name, }) => ({ - label, + label: name || "unnamed", value, })) || []; }, @@ -128,6 +130,13 @@ export default { default: LIMIT, optional: true, }, + offset: { + type: "integer", + label: "Offset", + description: "The number records to skip before returning results", + default: 0, + optional: true, + }, }, methods: { _client() {