fixed damaged deleting slots, see #5

This commit is contained in:
Jottyfan
2024-11-11 23:03:21 +01:00
parent a1ad23920a
commit bf88306d85
12 changed files with 59 additions and 25 deletions

View File

@@ -30,20 +30,20 @@ public class SlotController extends CommonController {
}
@GetMapping("/slot/{id}")
public String load(@PathVariable Integer id, Model model) {
public String load(@PathVariable("id") Integer id, Model model) {
model.addAttribute("bean", id == null ? new SlotBean() : service.loadSlot(id));
model.addAttribute("hasLesson", service.slotHasLesson(id));
return "/slot/item";
}
@GetMapping("/slot/{id}/delete")
public String loadEnsurance(@PathVariable Integer id, Model model) {
public String loadEnsurance(@PathVariable("id") Integer id, Model model) {
model.addAttribute("bean", service.loadDeletableSlot(id));
return "/slot/delete";
}
@GetMapping("/slot/{id}/destroy")
public String destroy(@PathVariable Integer id, Model model) {
public String destroy(@PathVariable("id") Integer id, Model model) {
service.removeSlot(id);
return "redirect:/";
}

View File

@@ -139,7 +139,7 @@ public class SlotRepository {
.selectFrom(T_LESSON)
.where(T_LESSON.FK_SLOT.eq(slotId));
// @formatter:on
LOGGER.trace(sql);
LOGGER.info(sql);
return sql.fetch().size() > 0;
}
}