From 8eebbaa417a85e16ea3c4ed2dfcbf79be1db5e70 Mon Sep 17 00:00:00 2001 From: Khaled Garbaya Date: Fri, 1 Dec 2017 12:31:55 +0100 Subject: [PATCH] feat: seperate querying for entries and assets --- lib/get/get-full-source-space.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/get/get-full-source-space.js b/lib/get/get-full-source-space.js index c6be2d80..5cfb9f26 100644 --- a/lib/get/get-full-source-space.js +++ b/lib/get/get-full-source-space.js @@ -23,7 +23,8 @@ export default function getFullSourceSpace ({ includeDrafts, maxAllowedLimit, listrOptions, - query + queryEntries, + queryAssets }) { pageLimit = maxAllowedLimit || MAX_ALLOWED_LIMIT listrOptions = listrOptions || { @@ -73,7 +74,7 @@ export default function getFullSourceSpace ({ title: 'Fetching content entries data', task: (ctx, task) => { const teardownTaskListeners = logToTaskOutput(task) - return pagedGet({space: ctx.space, method: 'getEntries', query}) + return pagedGet({space: ctx.space, method: 'getEntries', query: queryEntries}) .then(extractItems) .then(sortEntries) .then((items) => filterDrafts(items, includeDrafts)) @@ -87,11 +88,8 @@ export default function getFullSourceSpace ({ { title: 'Fetching assets data', task: (ctx, task) => { - const assetsQuery = Object.assign({}, query) - // no content_type query for the assets endpoint - delete assetsQuery.content_type const teardownTaskListeners = logToTaskOutput(task) - return pagedGet({space: ctx.space, method: 'getAssets', assetsQuery}) + return pagedGet({space: ctx.space, method: 'getAssets', query: queryAssets}) .then(extractItems) .then((items) => { ctx.data.assets = items