File tree Expand file tree Collapse file tree 1 file changed +22
-13
lines changed
components/gong/actions/get-extensive-data Expand file tree Collapse file tree 1 file changed +22
-13
lines changed Original file line number Diff line number Diff line change 11import app from "../../gong.app.mjs" ;
22import constants from "../../common/constants.mjs" ;
3+ import { ConfigurationError } from "@pipedream/platform" ;
34
45export default {
56 key : "gong-get-extensive-data" ,
@@ -70,21 +71,29 @@ export default {
7071 ...filter
7172 } = this ;
7273
73- const calls = await app . paginate ( {
74- resourceFn : getExtensiveData ,
75- resourceFnArgs : {
76- $,
77- data : {
78- filter,
74+ if ( filter ?. workspaceId && filter ?. callIds ) {
75+ throw new ConfigurationError ( "Must not provide both `callIds` and `workspaceId`" ) ;
76+ }
77+
78+ try {
79+ const calls = await app . paginate ( {
80+ resourceFn : getExtensiveData ,
81+ resourceFnArgs : {
82+ $,
83+ data : {
84+ filter,
85+ } ,
7986 } ,
80- } ,
81- resourceName : "calls" ,
82- max : maxResults ,
83- } ) ;
87+ resourceName : "calls" ,
88+ max : maxResults ,
89+ } ) ;
8490
85- if ( calls ?. length ) {
86- $ . export ( "$summary" , `Successfully retrieved data for ${ calls . length } calls` ) ;
91+ if ( calls ?. length ) {
92+ $ . export ( "$summary" , `Successfully retrieved data for ${ calls . length } calls` ) ;
93+ }
94+ return calls ;
95+ } catch {
96+ $ . export ( "$summary" , "No calls found matching the provided criteria" ) ;
8797 }
88- return calls ;
8998 } ,
9099} ;
You can’t perform that action at this time.
0 commit comments