mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
Fix subreddit:getAll with keyword search
This commit is contained in:
parent
58e44fa5dc
commit
52dd2502fd
|
@ -365,10 +365,17 @@ export class Reddit implements INodeType {
|
||||||
} else if (filters.keyword) {
|
} else if (filters.keyword) {
|
||||||
|
|
||||||
const qs: IDataObject = {};
|
const qs: IDataObject = {};
|
||||||
const endpoint = 'api/search_subreddits.json';
|
|
||||||
qs.query = filters.keyword;
|
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 {
|
} else {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue