From 52dd2502fdb3c1e01d7e993c86394dee21b70eca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Mon, 1 Feb 2021 15:48:18 -0300 Subject: [PATCH] Fix subreddit:getAll with keyword search --- packages/nodes-base/nodes/Reddit/Reddit.node.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/nodes-base/nodes/Reddit/Reddit.node.ts b/packages/nodes-base/nodes/Reddit/Reddit.node.ts index 59bdaa4905..a3575afea4 100644 --- a/packages/nodes-base/nodes/Reddit/Reddit.node.ts +++ b/packages/nodes-base/nodes/Reddit/Reddit.node.ts @@ -365,10 +365,17 @@ export class Reddit implements INodeType { } else if (filters.keyword) { const qs: IDataObject = {}; - const endpoint = 'api/search_subreddits.json'; qs.query = filters.keyword; - responseData = await handleListing.call(this, i, endpoint, qs, 'POST'); + const endpoint = 'api/search_subreddits.json'; + responseData = await redditApiRequest.call(this, 'POST', endpoint, qs); + + const returnAll = this.getNodeParameter('returnAll', 0) as boolean; + + if (returnAll === false) { + const limit = this.getNodeParameter('limit', 0) as number; + responseData = responseData.subreddits.splice(0, limit); + } } else {