File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
components/trengo/actions/list-articles Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,12 @@ export default {
3939 description : "The article's search term (if not specified, all articles will be returned)" ,
4040 optional : true ,
4141 } ,
42+ maxResults : {
43+ type : "integer" ,
44+ label : "Max Results" ,
45+ description : "Maximum number of articles to return (if not specified, all results will be returned)" ,
46+ optional : true ,
47+ } ,
4248 } ,
4349 async run ( { $ } ) {
4450 const articles = [ ] ;
@@ -55,6 +61,9 @@ export default {
5561 } ) ;
5662 for await ( const item of resourcesStream ) {
5763 articles . push ( item ) ;
64+ if ( this . maxResults && articles . length >= this . maxResults ) {
65+ break ;
66+ }
5867 }
5968 const length = articles . length ;
6069 $ . export ( "$summary" , `Successfully retrieved ${ length } article${ length === 1
You can’t perform that action at this time.
0 commit comments