resources/assets/js/components/Note.js
/**
  **handling the submit of the new notes
  **/
handling the submit of the new notes
handling the submit of the new notes
handleNewNote(values){
    var self = this
    self.props.loading("Inserting new Note Please Wait")
    values = {...values, UserID:this.props.id,writer:localStorage.getItem("id")}
    console.log("submit notes",values)
    axios.post("/api/createnote/",values).then(
      function(response){
        return response
      }).then(
        function(result){
          if(result.data.success){
            self.props.success(result.data.msg)
            self.fetchNotes()
          }else{
            self.props.failed(result.data.msg)
          }
        }
        ).catch(function(error){
          self.props.failed("Sorry an Error has Occurred")
        })
  }
handleNewNote ( values ) { var self = this self . props . loading ( "Inserting new Note Please Wait" ) values = { ... values , UserID : this . props . id , writer : localStorage . getItem ( "id" ) } console . log ( "submit notes" , values ) axios . post ( "/api/createnote/" , values ) . then ( function ( response ) { return response } ) . then ( function ( result ) { if ( result . data . success ) { self . props . success ( result . data . msg ) self . fetchNotes ( ) } else { self . props . failed ( result . data . msg ) } } ) . catch ( function ( error ) { self . props . failed ( "Sorry an Error has Occurred" ) } ) }
handling the submit of the new notes
handling the submit of the new notes
//assigning more detailed property for writer id and user id // values.UserID = this.props.id // values.writer = localStorage.getItem("id")