Почему данные формы не сохраняются в req.body?
EJS / HTML
<form onsubmit="EditJob()" class="editForm">
<div class="form-group-edit">
<label for="position">Position</label>
<input type="position" id="position" name="position" class="form-control" placeholder="Enter Position Title"
/>
</div>
<div class="form-group-edit">
<label for="company">Company</label>
<input type="company" id="company" name="company" class="form-control" placeholder="Enter Company Name"
/>
</div>
<button type="submit" class="edit">
<i class="fas fa-plus"></i>
</button>
</form>
Клиент JS
const EditJob = () => {
const id = ####;
const url = `http://localhost:5000/dashboard/${id}`;
axios.put(url).then(res => {
console.log(res);
});
};
Сервер JS
router.put("/:id", (req, res) => {
Job.findByIdAndUpdate(req.params.id, {
position: req.body.position,
company: req.body.company,
status: req.body.status
})
...
...
});
Обновленный do c в моей базе данных приводит к {position: null, company: null, status: null} ..