From 768ffcc1f60476f5fe7635650b56cacd6d44e085 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Till=20Gl=C3=B6ggler?= Date: Mon, 13 May 2024 14:49:25 +0200 Subject: [PATCH] fixes #970 --- src/OpencastApi/Rest/OcPlaylistsApi.php | 8 +++++--- tests/DataProvider/PlaylistsDataProvider.php | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) 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"}]'); } } ?>