Skip to content

Commit aa1f1a6

Browse files
committed
fixed empty post body
1 parent 584a19d commit aa1f1a6

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/Endpoints/Database.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ public function __construct(string $databaseId, Notion $notion)
3131

3232
public function query(): Collection
3333
{
34+
$postData = [];
35+
3436
if ($this->sorts->isNotEmpty())
3537
$postData["sorts"] = Sorting::sortQuery($this->sorts);
3638

@@ -43,15 +45,15 @@ public function query(): Collection
4345
if ($this->pageSize !== null)
4446
$postData["page_size"] = $this->pageSize;
4547

48+
4649
$response = $this
4750
->post(
4851
$this->url(Endpoint::DATABASES . "/{$this->databaseId}/query"),
4952
$postData
5053
)
54+
5155
->json();
5256

53-
// toDo return Database Entity
54-
// dd($response);
5557
$pageCollection = new PageCollection($response);
5658
return $pageCollection->getResults();
5759
}

src/Endpoints/Endpoint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Endpoint
2121

2222

2323
protected ?StartCursor $startCursor = null;
24-
protected ?int $pageSize = null;
24+
protected int $pageSize = 100;
2525

2626
public function __construct(Notion $notion)
2727
{

0 commit comments

Comments
 (0)