Skip to content

Commit 94053c5

Browse files
committed
updates
1 parent 22afa52 commit 94053c5

File tree

1 file changed

+22
-13
lines changed

1 file changed

+22
-13
lines changed

components/gong/actions/get-extensive-data/get-extensive-data.mjs

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import app from "../../gong.app.mjs";
22
import constants from "../../common/constants.mjs";
3+
import { ConfigurationError } from "@pipedream/platform";
34

45
export 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
};

0 commit comments

Comments
 (0)