Skip to content

Commit b6de681

Browse files
committed
Updating Story endpoint
1 parent e98f212 commit b6de681

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

src/Endpoints/StoryApi.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,5 +106,20 @@ public function create(StoryData $storyData): StoryblokResponseInterface
106106
}
107107

108108

109+
public function update(string $storyId, StoryData $storyData): StoryblokResponseInterface
110+
{
111+
return $this->makeRequest(
112+
"PUT",
113+
"/v1/spaces/" . $this->spaceId . "/stories/" . $storyId,
114+
[
115+
"body" => [
116+
"story" => $storyData->toArray(),
117+
],
118+
],
119+
dataClass: StoryData::class,
120+
);
121+
}
122+
123+
109124

110125
}

tests/Architecture/BasicTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
arch()
6+
->expect('Storyblok\Mapi\Endpoints')
7+
->toUseStrictTypes()
8+
->not->toUse(['die', 'dd', 'dump', 'echo', 'print_r']);
9+
10+
arch()->preset()->php();

0 commit comments

Comments
 (0)