@RequestMapping(value = "/{tagId}/delete", method = RequestMethod.POST)
public String delete(@PathVariable String tagId, RedirectAttributes redirectAttributes) {
try {
tagRepository.delete(tagId);
toast(redirectAttributes, message(Consts.Messages.DELETE_SUCCESSFULLY));
} catch (DataIntegrityViolationException e) {
toast(redirectAttributes, message(Consts.Messages.DELETE_TAG_FAILD));
}
return "redirect:/tags/index";
}
相关分类