Skip to content

Conversation

ren0v
Copy link
Contributor

@ren0v ren0v commented Feb 8, 2024

Some Page Properties (Date, Email, Number, PhoneNumber, RichTextProperty, Select, Url) have a CreateEmpty method but other editable properties (Checkbox, Files, Multiselect, People, Relation, Status, Title) don't have such a method.

This PR is about

  • Adding the missing createEmpty() method to all editable properties.
  • Improving the createEmpty() method by allowing to pass the id of the property so that we can have a fresh empty property set with the right id.

Copy link
Owner

@mariosimao mariosimao left a comment

Choose a reason for hiding this comment

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

Hi @ren0v. Thank you so much for your contributions.

What is the use case for createEmpty() with IDs? Is it to remove the data from a property? If yes, I think it would be better to have a new method, maybe clear()?

@ren0v
Copy link
Contributor Author

ren0v commented Feb 23, 2024

What is the use case for createEmpty() with IDs? Is it to remove the data from a property? If yes, I think it would be better to have a new method, maybe clear()?

Not really removing the data from a property.

I'm running an app that sync some Notion databases with the app and the other way around. For that, I rely on the ids of the Notion database properties as the enduser can change the name of the property on Notion. When the enduser makes an update on the app, I need to sync the update on Notion. For that, I create a new empty property with the SDK and I need to set the right id (that is saved on the app database), then I use a changeXXX method to add the new content and then run the update request with the API.

Remove null type for StatusOption in Pages\Properties\Status.
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.

2 participants