Merge pull request #600 from automatisch/refactor/remove-search-term
refactor: Do not expose search term separately for search tweets
This commit is contained in:
@@ -31,8 +31,6 @@ export default {
|
||||
],
|
||||
|
||||
async run($: IGlobalVariable) {
|
||||
return await searchTweets($, {
|
||||
searchTerm: $.step.parameters.searchTerm as string,
|
||||
});
|
||||
return await searchTweets($);
|
||||
},
|
||||
};
|
||||
|
@@ -7,15 +7,9 @@ import qs from 'qs';
|
||||
import generateRequest from '../../common/generate-request';
|
||||
import { omitBy, isEmpty } from 'lodash';
|
||||
|
||||
type ISearchTweetsOptions = {
|
||||
searchTerm: string;
|
||||
lastInternalId?: string;
|
||||
};
|
||||
const searchTweets = async ($: IGlobalVariable) => {
|
||||
const searchTerm = $.step.parameters.searchTerm as string;
|
||||
|
||||
const searchTweets = async (
|
||||
$: IGlobalVariable,
|
||||
options: ISearchTweetsOptions
|
||||
) => {
|
||||
let response;
|
||||
|
||||
const tweets: ITriggerOutput = {
|
||||
@@ -24,7 +18,7 @@ const searchTweets = async (
|
||||
|
||||
do {
|
||||
const params: IJSONObject = {
|
||||
query: options.searchTerm,
|
||||
query: searchTerm,
|
||||
since_id: $.execution.testRun ? null : $.flow.lastInternalId,
|
||||
pagination_token: response?.data?.meta?.next_token,
|
||||
};
|
||||
|
Reference in New Issue
Block a user