examples/opta-mern-stack/client/src/components/edit.js
// This will get the record based on the id from the database.
This will get the record based on the id from the database.
This will get the record based on the id from the database .
componentDidMount() {
    const api_endpoint = Config.API_ENDPOINT;
    axios
      .get(api_endpoint + "/record/" + this.props.match.params.id)
      .then((response) => {
        this.setState({
          person_name: response.data.person_name,
          person_position: response.data.person_position,
          person_level: response.data.person_level,
        });
      })
      .catch(function (error) {
        console.log(error);
      });
  }
componentDidMount ( ) { const api_endpoint = Config . API_ENDPOINT ; axios . get ( api_endpoint + "/record/" + this . props . match . params . id ) . then ( ( response ) => { this . setState ( { person_name : response . data . person_name , person_position : response . data . person_position , person_level : response . data . person_level , } ) ; } ) . catch ( function ( error ) { console . log ( error ) ; } ) ; }
This will get the record based on the id from the database.
This will get the record based on the id from the database .