Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deal api crm.deals.searchApi.doSearch has an invalid sorts type #559

Open
voho opened this issue Nov 14, 2024 · 3 comments
Open

Deal api crm.deals.searchApi.doSearch has an invalid sorts type #559

voho opened this issue Nov 14, 2024 · 3 comments

Comments

@voho
Copy link

voho commented Nov 14, 2024

The type of sorts is an array of strings; however, according to your docs, it should be also possible to specify sorting directions like this:

    "sorts": [
      {
        "propertyName": "createdate",
        "direction": "DESCENDING"
      }
    ]
@kiransmith
Copy link

@voho I'm having the same problem - have you come across a working solution?

nicolasmondain added a commit to nicolasmondain/hubspot-api-nodejs that referenced this issue Nov 18, 2024
@nicolasmondain
Copy link

Just had a test on the crm.contacts.searchApi.doSearch (which works the exact same way):

  • results are returned properly depending on the direction
        const objectSearchRequest = {
          filterGroups: [{
            filters: [{ propertyName: 'firstname', operator: 'EQ', value: 'Nicolas' }],
          }],
          limit: 100,
          properties: ['firstname', 'lastname'],
          sorts: [{
            propertyName: 'lastname',
            direction: 'ASCENDING',
          }],
          after: 0,
        };

If you need your type definition to be up to date, I forked the repo a week ago and just applied an update that should resolve your issue. Going to open a new pull request.

> @hubspot/[email protected] test
> ts-node node_modules/jasmine/bin/jasmine --config=jasmine.json

Randomized with seed 75149
Started
......................................................................


70 specs, 0 failures
Finished in 0.083 seconds
Randomized with seed 75149 (jasmine --random=true --seed=75149)
nicolasmondain@MBP-de-Nicolas hubspot-api-nodejs % npm run lint

> @hubspot/[email protected] lint
> tslint -p tsconfig.json && npm run prettier:check


> @hubspot/[email protected] prettier:check
> prettier --check "{,**/}*.{js,ts}"

Checking formatting...
All matched files use Prettier code style!
nicolasmondain@MBP-de-Nicolas hubspot-api-nodejs %

@nicolasmondain
Copy link

@kiransmith f94df92

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants