Skip to content

Commit 4c347a2

Browse files
committed
move ConfigurationError to query method
1 parent ea0ddf2 commit 4c347a2

File tree

3 files changed

+9
-15
lines changed

3 files changed

+9
-15
lines changed

components/fireflies/actions/find-meeting-by-id/find-meeting-by-id.mjs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ export default {
3232
},
3333
});
3434

35-
if (meeting.errors?.length) {
36-
throw new ConfigurationError(`Error: ${meeting.errors[0].message}`);
37-
}
38-
3935
$.export("$summary", `Successfully found meeting with ID: ${this.meetingId}`);
4036
return meeting;
4137
},

components/fireflies/actions/find-recent-meeting/find-recent-meeting.mjs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ export default {
3232
},
3333
});
3434

35-
if (user.errors?.length) {
36-
throw new ConfigurationError(`Error: ${user.errors[0].message}`);
37-
}
38-
3935
const meetingId = user?.data?.user?.recent_meeting;
4036
if (!meetingId) {
4137
$.export("$summary", `No meeting found for user with ID ${this.userId}`);
@@ -51,10 +47,6 @@ export default {
5147
},
5248
});
5349

54-
if (meeting.errors?.length) {
55-
throw new ConfigurationError(`Error: ${meeting.errors[0].message}`);
56-
}
57-
5850
$.export("$summary", `Successfully fetched the most recent meeting for user with ID ${this.userId}`);
5951
return meeting;
6052
},

components/fireflies/fireflies.app.mjs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import { axios } from "@pipedream/platform";
1+
import {
2+
axios, ConfigurationError,
3+
} from "@pipedream/platform";
24
import constants from "./common/constants.mjs";
35
import queries from "./common/queries.mjs";
46

@@ -70,11 +72,15 @@ export default {
7072
},
7173
});
7274
},
73-
query(opts = {}) {
74-
return this._makeRequest({
75+
async query(opts = {}) {
76+
const response = await this._makeRequest({
7577
method: "POST",
7678
...opts,
7779
});
80+
if (response.errors?.length) {
81+
throw new ConfigurationError(`Error: ${response.errors[0].message}`);
82+
}
83+
return response;
7884
},
7985
},
8086
};

0 commit comments

Comments
 (0)