Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // controll untuk melakukan penyimpanan data inputan ke collection warga
- wargaController.update = function (req, res) {
- Warga.findByIdAndUpdate(req.params._id, {
- $set: {
- nama: req.body.nama,
- umur: req.body.umur,
- pekerjaan: req.body.pekerjaan,
- desa_id: req.body.desa_id
- }
- }, { new: true }, function (err, warganya) {
- if (err) {
- console.log(err);
- res.render('editwarga', { warganya: req.body });
- }
- res.redirect('http://localhost:3000');
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement