Having some difficulties in dealing with CRUD delete method on a Spring based project. Keep getting an 404 error. Due to the fact of me being a newbie to programming I'm not able to figure out the problem on my own. I tried to seek some solutions on various YouTube guides and articles, tried to re-write, but nothing helped. Huge thanks in advance to anyone who could help me out. Attached some portion of code that is dealing with DELETE method of CRUD:
Service:
public void deleteVisit(Long id) {
repository.delete(id);
}
Controller:
@DeleteMapping("delete-appointment/{id}")
public void deleteAppointment(@PathVariable Long id) {
dentistVisitRepository.delete(id);
}
Thymeleaf:
<td><a th:href="@{delete-appointment/{id}(id=${appointment.id})}">Delete</a></td>