I have a form here with the delete method being used:
<form action="/article/<%= articles[i]._id %>" method="DELETE"><button class="btn btn-danger" type="submit">Delete</button></form>
Then my routes for the article ID's look like this:
const articleById = require('../controllers/article/articleById')
router.get('/:id', articleById)
const deleteArticleById = require('../controllers/article/deleteArticleById')
router.delete('/:id', authLoggedIn, deleteArticleById)
The form should be using the router.delete with its controller but instead it is using the router.get and using that controller instead. I verified this by using console.log in each controller and when I submit that form it will send me to router.get instead. I'm not sure how to get the form to use the router.delete.