public/js/music_playlist.js
/**
 * Remove a song by its id.
 * 
 * @param {number} songId The song id of the song to be removed.
 */
Remove a song by its id.

@param {number} songId The song id of the song to be removed.
Remove a song by its id . @param { number } songId The song id of the song to be removed .
function deleteSong(songId) {
    var result = confirm("Do you want to delete this song?");
    if (result == false) {
        return;
    }
    var url = base_url + "/songs/" + songId.toString();    
    fetch(url, {
        credentials: "same-origin",
        method: 'DELETE',
        headers:{
            'Content-Type': 'application/json',
            'X-CSRF-TOKEN': getCSRFToken()
        }
    })
    .then(function(response) {
        return response.json();
    })
    .then(function(json) {
        loadPlaylistsWithSongs();
    });
}
function deleteSong ( songId ) { var result = confirm ( "Do you want to delete this song?" ) ; if ( result == false ) { return ; } var url = base_url + "/songs/" + songId . toString ( ) ; fetch ( url , { credentials : "same-origin" , method : 'DELETE' , headers : { 'Content-Type' : 'application/json' , 'X-CSRF-TOKEN' : getCSRFToken ( ) } } ) . then ( function ( response ) { return response . json ( ) ; } ) . then ( function ( json ) { loadPlaylistsWithSongs ( ) ; } ) ; }
Remove a song by its id.
Remove a song by its id .