Apply for Zend Framework Certification Training

NodeJs





Update 

 

Step 1) add code in userscontroller

exports.updateuser = async(request,response)=>{

    let registration_data = {"firstname":request.body.firstname,"lastname":request.body.lastname,

        "email":request.body.email,"mobileno":request.body.mobileno, "password":request.body.password}

    let userid = request.params.id;

    await users.findByIdAndUpdate(userid,registration_data)

    response.send(JSON.stringify({"message":'User Updated sucessfully'}))

}

 

Step 2) Add code in user routes

route.put('/updateuser/:id',usercontroller.updateuser)

 

< First Getting Started With CodeIgniter URL Routing >



Ask a question



  • Question:
    {{questionlistdata.blog_question_description}}
    • Answer:
      {{answer.blog_answer_description  }}
    Replay to Question


Back to Top