Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Portals committed May 20, 2024
1 parent 1a2b631 commit 0043e54
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,18 @@ public ModelAndView createAuthority(
return mv;
}

@DeleteMapping("/clients/{id}")
public ModelAndView deleteClient(@RequestHeader(value = "HX-Request", required = true) boolean htmxRequest,
@PathVariable("id") UUID clientUid) {
try {
this.clientFacade.delete(clientUid);
} catch (ClientFacade.ClientNotFoundException e) {
throw new RuntimeException(e);
}

return new ModelAndView("redirect:/clients");
}

@DeleteMapping("/clients/{id}/authority/{name}")
public ModelAndView deleteClientAuthority(
@RequestHeader(value = "HX-Request", required = true) boolean htmxRequest,
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/resources/templates/pages/client-details.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
<span th:each="restrictionSuperGroup, stat : ${client.restriction().superGroups()}" th:text="${restrictionSuperGroup.prettyName() + (stat.count == client.restriction().superGroups().size() ? '' : ', ')}"></span>
</li>
</ul>
<footer>
<form data-hx-confirm="Are you sure you want to delete this client?" th:action="|/clients/${clientUid}|" th:method="delete">
<button class="outline contrast" data-loading-disable>Delete</button>
</form>
</footer>
</article>

<th:block th:each="clientAuthority : ${clientAuthorities}">
Expand Down
44 changes: 0 additions & 44 deletions app/src/main/resources/templates/pages/user-client-details.html

This file was deleted.

0 comments on commit 0043e54

Please sign in to comment.