Skip to content

Commit

Permalink
Playlist update endpoint fix (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
tgloeggl committed Jun 12, 2024
1 parent 4209600 commit f656214
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/OpencastApi/Rest/OcPlaylistsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/DataProvider/PlaylistsDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"}]');
}
}
?>

0 comments on commit f656214

Please sign in to comment.