function getEditablePlaylist
getEditablePlaylist(
playlistId: string,
requestingUserId: string,
canModerate: boolean
): Playlist

Returns the playlist if requestingUserId may edit it. The cover upload route checks this before it writes the file, then calls setPlaylistImage.

Parameters

playlistId: string
requestingUserId: string
canModerate: boolean

Return Type

Throws

APIException

404 when there is no such playlist, 403 when the user is neither its owner nor a moderator.

Usage

import { getEditablePlaylist } from "api/services/playlist-service.ts";