function deleteValue(e){
    let deleteField = e.target.parentNode.id.slice(7)
    deleteField = deleteField.split("-").shift()
    let deleteWork = e.target.parentNode.id.slice(14)

    fetch(`/api/favorites/${deleteWork}/${deleteField}`, {
        method: "DELETE"
    })
    .then(res => res.json())
    .then(() => location.reload())
}
/**
 * on click of the trash can icon
 * find which field was clicked (either title or author)
 * and delete the field from that entry
 */
on click of the trash can icon
find which field was clicked (either title or author)
and delete the field from that entry
on click of the trash can icon find which field was clicked ( either title or author ) and delete the field from that entry
function deleteValue(e){
    let deleteField = e.target.parentNode.id.slice(7)
    deleteField = deleteField.split("-").shift()
    let deleteWork = e.target.parentNode.id.slice(14)
    fetch(`/api/favorites/${deleteWork}/${deleteField}`, {
        method: "DELETE"
    })
    .then(res => res.json())
    .then(() => location.reload())
}
function deleteValue ( e ) { let deleteField = e . target . parentNode . id . slice ( 7 ) deleteField = deleteField . split ( "-" ) . shift ( ) let deleteWork = e . target . parentNode . id . slice ( 14 ) fetch ( ` ${ deleteWork } ${ deleteField } ` , { method : "DELETE" } ) . then ( res => res . json ( ) ) . then ( ( ) => location . reload ( ) ) }
on click of the trash can icon
 find which field was clicked (either title or author)
 and delete the field from that entry
on click of the trash can icon find which field was clicked ( either title or author ) and delete the field from that entry