Closed Armster15 closed 1 year ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated (UTC) |
---|---|---|---|
react-notion-x | ✅ Ready (Inspect) | Visit Preview | Jul 7, 2023 8:47pm |
react-notion-x-minimal-demo | ✅ Ready (Inspect) | Visit Preview | Jul 7, 2023 8:47pm |
thanks @Armster15 appreciate it
@transitive-bullshit please approve this pull request
Thanks!
the bug has fixed, but version: "6.16.1" donesn't publish at npm
Description
Problem: The search function is currently broken: we get a mysterious 405 error when we prop open the dev console and inspect the search request:
It turns out that Notion slightly changed the API for search, resulting in the way the library
notion-client
sends the API request to Notion for searching to be broken and throw an error:The request body in the above screenshot was generated by
notion-client
and I just put it in Postman to show the error that is thrown by the Notion API.Luckily this was a quick fix! I went to Notion and performed a search and inspected how they sent the API request, and noticed a slight difference:
For the
sort
key,notion-client
currently sends the following:While the Notion web app sends:
So I changed
notion-client
to send thesort
the same way the Notion web app sends it (which you can see in the code of this pull request) and the search function started working again!Notion Test Page ID
cebbcc4b7b784d63819ef7db02054b49