diff --git a/src/OpencastApi/Rest/OcPlaylistsApi.php b/src/OpencastApi/Rest/OcPlaylistsApi.php index b006cdc..b14bef7 100644 --- a/src/OpencastApi/Rest/OcPlaylistsApi.php +++ b/src/OpencastApi/Rest/OcPlaylistsApi.php @@ -132,14 +132,16 @@ public function delete($playlistId) */ public function updateEntries($playlistId, $playlistEntries) { - $uri = self::URI . "/{$playlistId}/entries"; + $uri = self::URI . "/{$playlistId}"; $formData = [ - 'playlistEntries' => $playlistEntries, + 'playlist' => [ + 'entries' => $playlistEntries + ] ]; $options = $this->restClient->getFormParams($formData); - return $this->restClient->performPost($uri, $options); + return $this->restClient->performPut($uri, $options); } /** diff --git a/tests/DataProvider/PlaylistsDataProvider.php b/tests/DataProvider/PlaylistsDataProvider.php index 2576995..ea4884a 100644 --- a/tests/DataProvider/PlaylistsDataProvider.php +++ b/tests/DataProvider/PlaylistsDataProvider.php @@ -20,7 +20,7 @@ public static function getPlaylist() public static function getEntries() { - return '[{"contentId":"ID-about-opencast","type":"EVENT"},{"contentId":"ID-3d-print","type":"EVENT"}]'; + return json_decode('[{"contentId":"ID-about-opencast","type":"EVENT"},{"contentId":"ID-3d-print","type":"EVENT"}]'); } } ?>