Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // controll untuk melakukan hapus data
- wargaController.delete = function (req, res) {
- Warga.findOne({ _id: req.params._id }, function (err, row) {
- if (row) {
- console.log(row);
- Warga.remove({ _id: req.params._id }, function (err) {
- // If error
- if (err) {
- console.log("Delete Warga Error", err);
- }
- else {
- console.log("Warga deleted!");
- res.redirect('http://localhost:3000');
- }
- });
- }
- else {
- res.redirect('http://localhost:3000');
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement