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 {
14
14
"conversationId" ,
15
15
] ,
16
16
} ,
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
+ } ,
17
25
} ,
18
26
async run ( { $ } ) {
19
- const response = ( await this . helpScout . getConversationThreads ( {
27
+ const response = await this . helpScout . getConversationThreads ( {
20
28
$,
21
29
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 ;
23
37
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
+ } ;
26
43
} ,
27
44
} ;
You can’t perform that action at this time.
0 commit comments