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

Applies req to a playlist for PUT /api/playlists/:playlistId, and returns it as it now is. A new slug goes through changeSlug, first, and a moderator is exempt from its rate limit; a new title leaves the slug as it is. canModerate lets someone other than the owner edit it. If the playlist is public, it notifies, in the owner's name, the users the description mentions. When it goes public, its followers are notified of its public dumps they weren't yet told of. It links the description's attachments and tells clients of the change (broadcastPlaylistChange).

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, 400 when the slug isn't valid or a category id names no playlist category, 409 when the slug is taken, 429 when it changed too often lately.

Usage

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