examples/opta-mern-stack/client/src/components/recordList.js
// This method will delete a record based on the method
This method will delete a record based on the method
This method will delete a record based on the method
deleteRecord(id) {
    const api_endpoint = Config.API_ENDPOINT;
    axios.delete(api_endpoint + "/" + id).then((response) => {
      console.log(response.data);
    });
    this.setState({
      record: this.state.records.filter((el) => el._id !== id),
    });
  }
deleteRecord ( id ) { const api_endpoint = Config . API_ENDPOINT ; axios . delete ( api_endpoint + "/" + id ) . then ( ( response ) => { console . log ( response . data ) ; } ) ; this . setState ( { record : this . state . records . filter ( ( el ) => el . _id !== id ) , } ) ; }
This method will delete a record based on the method
This method will delete a record based on the method