use of com.erudika.scoold.core.Report in project scoold by Erudika.
the class ReportsController method delete.
@PostMapping("/{id}/delete")
public String delete(@PathVariable String id, HttpServletRequest req, HttpServletResponse res) {
if (utils.isAuthenticated(req)) {
Profile authUser = utils.getAuthUser(req);
Report rep = pc.read(id);
if (rep != null && utils.isAdmin(authUser)) {
rep.delete();
}
}
if (!utils.isAjaxRequest(req)) {
return "redirect:" + reportslink;
}
return "base";
}
Aggregations