Closed Berdir closed 1 year ago
Hi @Berdir, sorry for the late response. The property you are trying to delete is of type URL? If yes, indeed there is no possible way to delete yet.
@Berdir I have just released v1.10. It includes new methods for creating and updating page properties with empty values.
There are now two possible ways to clear the value of a property:
$page = $notion
->pages()
->find($pageId)
->addProperty("Property name", Url::createEmpty());
$notion->pages()->update($page);
$page = $notion->pages()->find($pageId);
$property = $page->properties()->getUrl("Property name");
$property = $property->clear();
$page = $page->addProperty("Property name", $property);
$notion->pages()->update($page);
Hi. Thanks, I'd consider that very fast feedback, not slow. Will test this.
Is your feature request related to a problem? Please describe.
First I thought being able to delete properties is only missing as a dedicated PHP method, but even doing the following does nothing, so I guess properties that aren't being sent are not removed:
Setting the value to empty apparently also doesn't work, resulting in the following errors:
Nor is it possible to pass NULL as the value, as it is type hinted on string.
Describe the solution you'd like
Support NULL values? add removeProperty() methods? Not sure how it needs to work on the API level against Notiion.