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

unable to remove the value of select #140

Open
DoneSpeak opened this issue Jun 11, 2023 · 0 comments
Open

unable to remove the value of select #140

DoneSpeak opened this issue Jun 11, 2023 · 0 comments

Comments

@DoneSpeak
Copy link

DoneSpeak commented Jun 11, 2023

I can use the following request to remove the value of select.

PATCH https://api.notion.com/v1/pages/:id
{
    "properties": {
        "ProjectType": {
            "select": null
        }
    }
}

But when used the notionapi pkg to send the request, I cann't set the select to nil. Because the type of select is notionapi.Option instead of *notionapi.Option.

type SelectProperty struct {
	ID     ObjectID           `json:"id,omitempty"`
	Type   PropertyType `json:"type,omitempty"`
	Select Option            `json:"select"`
}

when I used notionapi.Option{} as the value of Select, I got the following errer response:

body.properties.ProjectType.select.id should be defined, instead was `undefined`.
body.properties.ProjectType.select.name should be populated, instead was `""`.

How can I remove the value of select propery?

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

1 participant