답변 삭제
·
BACKEND/SpringBoot
question_detail.html 에 삭제 버튼 추가 AnswerService //답변 삭제하기 public void delete(Answer answer) { aRepo.delete(answer); } AnswerController //답변 삭제 처리 @PreAuthorize("isAuthenticated()") @GetMapping("/delete/{id}") public String answerDelete(Principal principal,@PathVariable("id") int id ) { Answer answer = aService.getAnswer(id); if(!answer.getAuthor().getUsername().equals(principal.getName())) { throw..