Commit db13bd61 authored by Matúš Valko's avatar Matúš Valko
Browse files

updated

parent b7bd53ff
Pipeline #141721 passed with stage
in 1 minute and 33 seconds
......@@ -66,4 +66,16 @@ public class TeamController {
redirectAttributes.addFlashAttribute("alert_success", "Team " + id + " was created");
return "redirect:" + uriBuilder.path("/team/view/{id}").buildAndExpand(id).encode().toUriString();
}
@RequestMapping(value = "/delete/{uuid}", method = RequestMethod.POST)
public String delete(@PathVariable String uuid, UriComponentsBuilder uriBuilder, RedirectAttributes redirectAttributes) {
TeamDTO player = teamFacade.getTeamById(uuid);
try {
teamFacade.delete(uuid);
redirectAttributes.addFlashAttribute("alert_success", "Team \"" + player.getId() + "\" was deleted.");
} catch (Exception ex) {
redirectAttributes.addFlashAttribute("alert_danger", "Team \"" + player.getId() + "\" cannot be deleted.");
}
return "redirect:" + uriBuilder.path("/team/list").toUriString();
}
}
......@@ -8,7 +8,9 @@
<my:pagetemplate title="Team Administration">
<jsp:attribute name="body">
<table class="table">
<td><c:out value="${team.name}"/></td>
<table class="tablePlayers">
<thead>
<tr>
<th>id</th>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment