File tree Expand file tree Collapse file tree 1 file changed +21
-4
lines changed
components/help_scout/actions/get-conversation-threads Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -14,14 +14,31 @@ export default {
1414 "conversationId" ,
1515 ] ,
1616 } ,
17+ page : {
18+ type : "integer" ,
19+ label : "Page" ,
20+ description : "Page number to retrieve. By default, the 25 most recent threads are retrieved (page 1)" ,
21+ optional : true ,
22+ default : 1 ,
23+ min : 1 ,
24+ } ,
1725 } ,
1826 async run ( { $ } ) {
19- const response = ( await this . helpScout . getConversationThreads ( {
27+ const response = await this . helpScout . getConversationThreads ( {
2028 $,
2129 conversationId : this . conversationId ,
22- } ) ) ?. _embedded ?. threads ;
30+ params : {
31+ page : this . page ,
32+ } ,
33+ } ) ;
34+
35+ const threads = response ?. _embedded ?. threads ;
36+ const pageInfo = response ?. page ;
2337
24- $ . export ( "$summary" , `Successfully retrieved ${ response ?. length || 0 } threads for conversation ID: ${ this . conversationId } ` ) ;
25- return response ;
38+ $ . export ( "$summary" , `Successfully retrieved ${ threads ?. length || 0 } threads for conversation ID: ${ this . conversationId } (Page ${ pageInfo ?. number + 1 || this . page } of ${ pageInfo ?. totalPages || "unknown" } )` ) ;
39+ return {
40+ threads,
41+ pagination : pageInfo ,
42+ } ;
2643 } ,
2744} ;
You can’t perform that action at this time.
0 commit comments