peopledatalabs / peopledatalabs-js

A universal JS client with TypeScript support for the People Data Labs API
https://docs.peopledatalabs.com/docs/javascript-sdk
MIT License
22 stars 9 forks source link

titlecase in bulk retrieve people function #51

Closed ded-ditat closed 1 year ago

ded-ditat commented 1 year ago

Is your feature request related to a problem? Please describe. It doesn't look like we can pass titlecase: true when using the bulk person retrieve function. It looks like the api supports this could it be added as a param?

Describe the solution you'd like Have titlecase as a param we can use in the bulk person retrieve function.

Describe alternatives you've considered If theres a good work around we're open.

Additional context We are using search preview in our front end and then use bulk retrieve calls with the pdl ids from the initial search. We have titlecase: true on the search params then end up returning lowercase everything with the retrieve function. We're enterprise customers as well.

vvillait88 commented 1 year ago

@ded-ditat i've opened a PR to support this. As soon as it's merged, you can pass in the titlecase flag as seen below.

const bulkRecords = {
  requests: [
    { id: 'qEnOZ5Oh0poWnQ1luFBfVw_0000' },
    { id: 'PzFD15NINdBWNULBBkwlig_0000' },
  ],
  titlecase: true,
};

try {
  const response = await PDLJSClient.person.bulk.retrieve(bulkRecords);

  console.log(response);
} catch (error) {
  console.log(error);
}