Skip to content

Commit

Permalink
Fix missing super group deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
Portals committed Aug 31, 2024
1 parent 1b796a2 commit 1768e52
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public ModelAndView deleteSuperGroup(
throw new RuntimeException(e);
}

return new ModelAndView("common/empty");
return new ModelAndView("redirect:/super-groups");
}

public record CreateSuperGroupForm(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,17 @@
<span th:text="${superGroup.type()}"></span>
</li>
</ul>
<footer>
<footer th:if="${isAdmin}">
<button th:data-hx-get="@{/super-groups/{superGroupId}/edit(superGroupId=${superGroup.id()})}"
class="outline contrast"
data-hx-target="closest article"
data-hx-swap="outerHTML">
Edit
</button>
<form data-hx-confirm="Are you sure you want to delete this super group?"
th:action="|/super-groups/${superGroup.id()}|" th:method="delete" th:if="${usages.size() == 0}">
<button class="outline contrast" data-loading-disable>Delete</button>
</form>
</footer>
</article>
<article>
Expand Down

0 comments on commit 1768e52

Please sign in to comment.