Skip to content

Commit df9ecb4

Browse files
committed
Added actions
1 parent 335ff74 commit df9ecb4

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

components/apollo_io/actions/update-contact/update-contact.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
name: "Update Contact",
77
description: "Updates an existing contact in Apollo.io. [See the documentation](https://apolloio.github.io/apollo-api-docs/?shell#update-a-contact)",
88
type: "action",
9-
version: "0.0.4",
9+
version: "0.0.{{ts}}",
1010
props: {
1111
app,
1212
contactId: {
@@ -83,7 +83,9 @@ export default {
8383
title: this.title,
8484
account_id: this.accountId,
8585
website_url: this.websiteUrl,
86-
label_names: this.labelNames,
86+
label_names: typeof this.labelNames === "string"
87+
? JSON.parse(this.labelNames)
88+
: this.labelNames,
8789
present_raw_address: this.address,
8890
direct_phone: this.phone,
8991
}),

components/apollo_io/apollo_io.app.mjs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,13 @@ export default {
173173
labelNames: {
174174
type: "string[]",
175175
label: "Label Names",
176-
description: "A list of names to tag this newly created contact. If the name does not exist, Apollo will automatically create it",
176+
description: "A list of names to tag this contact. You can select the labels from the list or create new ones using a custom expression, i.e., `[\"label1\", \"label2\"]`",
177177
optional: true,
178+
async options() {
179+
const response = await this.listLabels();
180+
console.log(response);
181+
return response.map(({ name }) => name) || [];
182+
},
178183
},
179184
address: {
180185
type: "string",
@@ -384,6 +389,12 @@ export default {
384389
...args,
385390
});
386391
},
392+
listLabels(args = {}) {
393+
return this.makeRequest({
394+
path: "/labels",
395+
...args,
396+
});
397+
},
387398
async *getResourcesStream({
388399
resourceFn,
389400
resourceFnArgs,

0 commit comments

Comments
 (0)