From e52847171daa1ef493548178ef2abac285bd4889 Mon Sep 17 00:00:00 2001 From: Divlo Date: Wed, 6 May 2020 09:55:27 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=A6=20NEW:=20Supprimer=20une=20fonctio?= =?UTF-8?q?n=20frontend?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- website/pages/admin/[slug].js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/website/pages/admin/[slug].js b/website/pages/admin/[slug].js index 261f9c2..fc10531 100644 --- a/website/pages/admin/[slug].js +++ b/website/pages/admin/[slug].js @@ -15,6 +15,11 @@ const AdminFunctionComponent = (props) => { const [slideIndex, setSlideIndex] = useState(0); + const handleDeleteFunction = async () => { + await api.delete(`/admin/functions/${props.functionInfo.id}`, { headers: { 'Authorization': props.user.token } }); + redirect({}, '/admin'); + } + return ( @@ -44,6 +49,9 @@ const AdminFunctionComponent = (props) => { user={props.user} isEditing /> +
+ +