Skip to content

Commit

Permalink
fix(page): do not update CreatedBy prop (#251)
Browse files Browse the repository at this point in the history
Closes #249
  • Loading branch information
youvalteboul authored Jun 15, 2023
1 parent 761a706 commit 42ad32c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Pages/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Notion\Blocks\BlockInterface;
use Notion\Configuration;
use Notion\Infrastructure\Http;
use Notion\Pages\Properties\CreatedBy;
use Notion\Pages\Properties\CreatedTime;
use Notion\Pages\Properties\LastEditedBy;
use Notion\Pages\Properties\LastEditedTime;
Expand Down Expand Up @@ -61,7 +62,7 @@ public function create(Page $page, array $content = []): Page
public function update(Page $page): Page
{
$updatableProps = array_filter($page->properties, function (PropertyInterface $p) {
$notUpdatableProps = [ CreatedTime::class, LastEditedBy::class, LastEditedTime::class ];
$notUpdatableProps = [ CreatedTime::class, LastEditedBy::class, LastEditedTime::class, CreatedBy::class ];

return (!in_array($p::class, $notUpdatableProps));
});
Expand Down

0 comments on commit 42ad32c

Please sign in to comment.