title: axios delete function not working
body: <p>I am trying to create a delete button, on my surveys i have the delete button and my end api created however nothing happens when i  hit delete on the survey please help. </p>
  
  <p>This is where my delete button and function is.
   created a new function called <code>newDelete</code> and passed it the survey._id but that is not working either</p>
  
  <p>SurveyList.js   </p>
  
  <pre><code>import React, { Component } from 'react';
  import { connect } from 'react-redux';
  import { fetchSurveys } from '../../actions';
  import { deleteSurvey } from '../../actions';
  
  class SurveyList extends Component {
    componentDidMount() {
      this.props.fetchSurveys();
    }
  
    newDelete() {
    deleteSurvey('{survey._id}');
    }
  
    renderSurveys() {
      return this.props.surveys.reverse().map(survey =&gt; {
        return (
          &lt;div className="card darken-1" key={survey._id}&gt;
            &lt;div className="card-content"&gt;
              &lt;span className="card-title"&gt;{survey.title}&lt;/span&gt;
              &lt;p&gt;
                {survey.body}
              &lt;/p&gt;
              &lt;p className="right"&gt;
              &lt;button type="button" onClick={this.newDelete}&gt;DELETE&lt;/button&gt;
                Sent On: {new Date(survey.dateSent).toLocaleDateString()}
              &lt;/p&gt;
            &lt;/div&gt;
  
          &lt;/div&gt;
        );
      });
    }
  
    render() {
      return (
        &lt;div&gt;
          {this.renderSurveys()}
        &lt;/div&gt;
      );
    }
  }
  
  function mapStateToProps({ surveys }) {
    return { surveys };
  }
  
  export default connect(mapStateToProps, { fetchSurveys })(SurveyList);
  </code></pre>
  
  <p>where i have my api's.</p>
  
  <pre><code>index.js 
  
  import axios from "axios";
  import { FETCH_USER, FETCH_SURVEYS } from "./types";
  
  
  export const fetchUser = () =&gt; async dispatch =&gt; {
    const res = await axios.get("/api/current_user");
  
    dispatch({ type: FETCH_USER, payload: res.data });
  };
  
  export const submitSurvey = (values, history) =&gt; async dispatch =&gt; {
    const res = await axios.post("/api/surveys", values);
  
    history.push("/surveys");
    dispatch({ type: FETCH_USER, payload: res.data });
  };
  
  export const fetchSurveys = () =&gt; async dispatch =&gt; {
    const res = await axios.get('/api/surveys');
  
      dispatch({type: FETCH_SURVEYS, payload: res.data })
  };
  
  export const deleteSurvey = (values, history) =&gt; async dispatch =&gt; {
    const res = await axios.delete('api/surveys', {params: {'_id': values}});
  
    history.push("/surveys");
    dispatch({ type: FETCH_USER, payload: res.data });
  };
  </code></pre>
  
  <p>this is the part of the code where i am trying to just delete the surveys.  any help will be greatly appreciated thanks.nothing happens no errors nor any console issues.</p>