handleLocationDelete(loc){
    let  self  =  this;
    locationService.deleteLocation(loc).then(()=>{
        let  newArr  =  self.state.locations.filter(function(obj) {
            return  obj.id  !==  loc.id;
        });
        self.setState({locations: newArr, filtered_locations: newArr})
    });
}
/**
 * Event handler used to delete a location from the database when the 
 * user clicks on the delete button.
 * @param {Object} loc The location object to be deleted.
 */
Event handler used to delete a location from the database when the
user clicks on the delete button.
@param {Object} loc The location object to be deleted.
Event handler used to delete a location from the database when the user clicks on the delete button . @param { Object } loc The location object to be deleted .
handleLocationDelete(loc){
    let  self  =  this;
    locationService.deleteLocation(loc).then(()=>{
        let  newArr  =  self.state.locations.filter(function(obj) {
            return  obj.id  !==  loc.id;
        });
        self.setState({locations: newArr, filtered_locations: newArr})
    });
}
handleLocationDelete ( loc ) { let self = this ; locationService . deleteLocation ( loc ) . then ( ( ) => { let newArr = self . state . locations . filter ( function ( obj ) { return obj . id !== loc . id ; } ) ; self . setState ( { locations : newArr , filtered_locations : newArr } ) } ) ; }
Event handler used to delete a location from the database when the
 user clicks on the delete button.
Event handler used to delete a location from the database when the user clicks on the delete button .