Open ren0v opened 9 months ago
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, maybeclear()
?
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.
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
createEmpty()
method to all editable properties.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.