From 3c0c8d1e73b949a43de3e41d485ae42341b25dff Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 12 Oct 2021 03:36:29 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Simplify=20`GroupDeleteButton`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/group/GroupDeleteButton.tsx | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/frontend/src/components/group/GroupDeleteButton.tsx b/frontend/src/components/group/GroupDeleteButton.tsx index 8e2aea4..8958454 100644 --- a/frontend/src/components/group/GroupDeleteButton.tsx +++ b/frontend/src/components/group/GroupDeleteButton.tsx @@ -15,14 +15,6 @@ export interface GroupDeleteButtonProps { export function GroupDeleteButton({resource}: GroupDeleteButtonProps): JSX.Element | null { const authorization = useAuthorizationContext() - const doDelete = - React.useCallback( - async () => { - await resource.destroy() - }, - [resource], - ) - if(!authorization) { return null } @@ -34,7 +26,7 @@ export function GroupDeleteButton({resource}: GroupDeleteButtonProps): JSX.Eleme } return ( - + resource.destroy()}>  Delete )