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

fix(search): fix search error not being passed to NotionRenderer properly #619

Closed
wants to merge 1 commit into from

Conversation

nynevi
Copy link

@nynevi nynevi commented Jun 27, 2024

Fixes #618
The search still does not work mainly due to the fact that this call fails: https://github.com/NotionX/react-notion-x/blob/master/packages/notion-client/src/notion-api.ts#L606

endpoint of Notion https://www.notion.so/api/v3/search does not seem to be publicly documented.
This CURL fails:

curl --location 'https://www.notion.so/api/v3/search' \
--header 'Content-Type: application/json' \
--header 'Cookie: __cf_bm=l9fYQeZBInjE_IYkZfI39Rl84cClfIeJ9kCFQsKLGpc-1719470820-1.0.1.1-qFgBx5G_xqV_lkEMjjrVP5CSifPI.ZZ5vTvMbItNYy0tlItIWVr46e_2qYJYcXpmkS7OvvPlmWZCcr_ttBADkw; _cfuvid=T0dzvs1rxC8sFknZk47Efnx912M1XYiciVUPvyZ8S8A-1719470820038-0.0.1.1-604800000; device_id=6513a169-b1fc-404a-9ce8-3d4f6e450778; notion_browser_id=5d90bc05-2cad-4554-b6c5-f9bb2da47c67; notion_check_cookie_consent=false' \
--data '{
    "type": "BlocksInAncestor",
    "source": "quick_find_public",
    "ancestorId": "0191bcee-9db0-4c36-90b8-4062af8f12e2",
    "sort": "Relevance",
    "limit": 20,
    "query": "",
    "filters": {
        "isDeletedOnly": false,
        "isNavigableOnly": false,
        "excludeTemplates": true,
        "requireEditPermissions": false,
        "ancestors": [],
        "createdBy": [],
        "editedBy": [],
        "lastEditedTime": {},
        "createdTime": {}
    }
}'

response:

{
    "errorId": "519936dd-0928-445f-8a4f-f223acef4a89",
    "name": "ValidationError",
    "debugMessage": "Invalid input.",
    "message": "Something went wrong. (400)"
}

This is a separate task on its own on https://github.com/NotionX/react-notion-x repository NotionX/react-notion-x#555

Copy link

vercel bot commented Jun 27, 2024

@nynevi is attempting to deploy a commit to the Saasify Team on Vercel.

A member of the Team first needs to authorize it.

@nynevi nynevi changed the title fix(search): fix search error not being passed to NotionRenderer prop… fix(search): fix search error not being passed to NotionRenderer properly Jun 27, 2024
@nynevi nynevi closed this by deleting the head repository Jun 27, 2024
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.

Clicking on search causes an Internal Server Error
1 participant