Open utterances-bot opened 2 years ago
Thanks for the very simple and easy to understand tutorial
Facing issue while updating number from client side. While it is working fine through Postman.
Can you help?
You can simply use the PUT request instead of the PATCH in the backend portion here is the code example: app.put('/update-phone', async (req,res) => { const newPhone = req.body.newPhone const id = req.body.id try{ await PhoneBook.findById(id, (err,data) =>{ data.phone = newPhone data.save() res.send('Data has been updated successfully') }) }catch(err){ console.log(err) } })
It will solve your problem
Thanks it works now
in Update data with Axios.put (Line 71:8: 'phonebook' is not defined no-undef), where i can get phonebook.map, anyone can help ?
How to build a CRUD application using MERN stack - CodeSource.io
In this tutorial, we will use the MERN stack to create a CRUD application. We are going to create a simple PhoneBook app where a user
https://codesource.io/how-to-build-a-crud-application-using-mern-stack/