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

update search to use arrow function #330

Merged
merged 1 commit into from
Jul 26, 2022
Merged

Conversation

lao9
Copy link
Contributor

@lao9 lao9 commented Jul 25, 2022

Closes #329

Previous TypeError:

TypeError: Cannot read properties of undefined (reading 'request')
    at search (/path/to/node_modules/@notionhq/client/src/Client.ts:511:17)
    at iteratePaginatedAPI (/path/to/node_modules/@notionhq/client/src/helpers.ts:50:49)
    at iteratePaginatedAPI.next (<anonymous>)
    at example.example (/path/to/example.ts)

Passing in the listFn as client.search meant that this.request({...}) is unavailable unless search is an arrow function.

@lao9 lao9 requested a review from wcauchois July 25, 2022 17:15
Copy link
Contributor

@wcauchois wcauchois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks! Do you think this is worth a 2.1.1 release? 😄

@lao9 lao9 merged commit 7321fb9 into main Jul 26, 2022
@lao9 lao9 deleted the lo/update-search-to-arrow-fxn branch July 26, 2022 14:15
rhart92 pushed a commit that referenced this pull request Oct 3, 2023
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

Successfully merging this pull request may close these issues.

Paginated utility functions fail for search
3 participants