Skip to content

Commit 75df85e

Browse files
committed
Fixed requested changes
1 parent 83bc645 commit 75df85e

File tree

4 files changed

+46
-36
lines changed

4 files changed

+46
-36
lines changed

components/epsy/actions/email-lookup/email-lookup.mjs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,19 @@ export default {
1111
value: {
1212
propDefinition: [
1313
app,
14-
"value",
15-
],
14+
"value"
15+
]
1616
},
1717
},
1818

1919
async run({ $ }) {
2020
const response = await this.app.emailLookup({
2121
$,
22-
params: {
22+
data: {
2323
value: this.value,
24-
lookupId: "67",
25-
},
24+
lookupId: 67,
25+
}
2626
});
27-
2827
$.export("$summary", `Successfully sent request. Use the ID to get the results: '${response.id}'`);
2928

3029
return response;

components/epsy/actions/get-lookup-results/get-lookup-results.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@ export default {
2626
const response = await this.app.getLookupResults({
2727
$,
2828
searchId: this.searchId,
29-
params: {
29+
data: {
3030
value: this.value,
3131
},
32+
params: {
33+
key: `${this.app.$auth.api_key}`,
34+
},
3235
});
33-
3436
$.export("$summary", `Successfully retrieved the details of the request with ID: '${this.searchId}'`);
35-
3637
return response;
3738
},
3839
};

components/epsy/actions/name-lookup/name-lookup.mjs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,20 @@ export default {
1111
value: {
1212
propDefinition: [
1313
app,
14-
"value",
15-
],
14+
"value"
15+
]
1616
},
1717
},
1818

1919
async run({ $ }) {
2020
const response = await this.app.nameLookup({
2121
$,
22-
params: {
22+
data: {
2323
value: this.value,
24-
lookupId: "149",
25-
},
24+
lookupId: 149,
25+
}
2626
});
27-
2827
$.export("$summary", `Successfully sent request. Use the ID to get the results: '${response.id}'`);
29-
3028
return response;
3129
},
3230
};

components/epsy/epsy.app.mjs

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,13 @@ export default {
1414
label: "Search ID",
1515
description: "ID of the search",
1616
async options() {
17-
const searchIds = await this.getSearchIds();
18-
return searchIds.map(({
19-
id, type,
20-
}) => ({
21-
label: type,
17+
const response = await this.getSearchIds();
18+
const searchIds = response.list;
19+
return searchIds.map(({ id }) => ({
2220
value: id,
23-
}));
24-
},
25-
},
21+
}))
22+
}
23+
}
2624
},
2725
methods: {
2826
_baseUrl() {
@@ -33,48 +31,62 @@ export default {
3331
$ = this,
3432
path,
3533
headers,
36-
params,
34+
data,
3735
...otherOpts
3836
} = opts;
37+
console.log("Request Options:", {
38+
url: this._baseUrl() + path,
39+
headers: {
40+
...headers,
41+
accept: `application/json`,
42+
"content-type": `application/json`,
43+
},
44+
data: {
45+
...data,
46+
key: `${this.$auth.api_key}`,
47+
},
48+
...otherOpts,
49+
});
3950
return axios($, {
4051
...otherOpts,
4152
url: this._baseUrl() + path,
4253
headers: {
4354
...headers,
44-
"accept": "application/json",
45-
"content-type": "application/json",
55+
"accept": `application/json`,
56+
"content-type": `application/json`,
4657
},
47-
params: {
48-
...params,
58+
data: {
59+
...data,
4960
key: `${this.$auth.api_key}`,
50-
},
61+
}
5162
});
5263
},
5364
async emailLookup(args = {}) {
5465
return this._makeRequest({
55-
path: "/developer/combined_email",
66+
path: `/developer/combined_email`,
5667
method: "post",
5768
...args,
5869
});
5970
},
6071
async nameLookup(args = {}) {
6172
return this._makeRequest({
62-
path: "/developer/combined_name",
73+
path: `/developer/combined_name`,
6374
method: "post",
6475
...args,
6576
});
6677
},
67-
async getLookupResults({
68-
searchId, ...args
69-
}) {
78+
async getLookupResults({ searchId, ...args }) {
7079
return this._makeRequest({
7180
path: `/request-monitor/api-usage/${searchId}`,
7281
...args,
7382
});
7483
},
7584
async getSearchIds(args = {}) {
7685
return this._makeRequest({
77-
path: "/request-monitor/api-usage",
86+
path: `/request-monitor/api-usage`,
87+
params: {
88+
key: `${this.$auth.api_key}`,
89+
},
7890
...args,
7991
});
8092
},

0 commit comments

Comments
 (0)