Skip to content

unable to remove the value of select #140

@DoneSpeak

Description

@DoneSpeak

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions