Skip to content

Commit

Permalink
fix issues with sending array of profiles (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
vvillait88 authored Aug 13, 2022
1 parent 059b462 commit 6712127
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "peopledatalabs",
"version": "4.0.0",
"version": "4.0.1",
"description": "JavaScript client with TypeScript support for the People Data Labs API",
"type": "module",
"main": "dist/index.cjs",
Expand Down
8 changes: 8 additions & 0 deletions src/endpoints/enrichment/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ export default <T extends PersonEnrichmentParams | CompanyEnrichmentParams, K ex

const p = params;
delete p.sandbox;

Object.entries(p).forEach(([key, value]) => {
if (typeof value === 'object') {
// @ts-ignore
p[key] = JSON.stringify(value);
}
});

axios.get<K>(url, {
params: {
api_key: apiKey,
Expand Down
7 changes: 7 additions & 0 deletions src/endpoints/identify/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ export default (
const p = params;
delete p.sandbox;

Object.entries(p).forEach(([key, value]) => {
if (typeof value === 'object') {
// @ts-ignore
p[key] = JSON.stringify(value);
}
});

axios.get<IdentifyResponse>(url, {
params: {
api_key: apiKey,
Expand Down

0 comments on commit 6712127

Please sign in to comment.