From be493c34eeed92162b7800baaff9efea279d7a78 Mon Sep 17 00:00:00 2001 From: dim145 Date: Thu, 21 Nov 2024 11:57:40 +0100 Subject: [PATCH] d --- frontend/components/mailTemplates/TemplateEditor.jsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/frontend/components/mailTemplates/TemplateEditor.jsx b/frontend/components/mailTemplates/TemplateEditor.jsx index 08ca66c4..146588d6 100644 --- a/frontend/components/mailTemplates/TemplateEditor.jsx +++ b/frontend/components/mailTemplates/TemplateEditor.jsx @@ -12,7 +12,8 @@ export default function TemplateEditor() { const [event, setEvent] = useState(null); const fetchData = async () => { - try { + try + { await api.set() .success(res => { @@ -21,11 +22,13 @@ export default function TemplateEditor() { setLoading(false); setTemplateName(res.template.name); }) - .error(res => { + .error(res => + { swal("Une erreur est survenue lors de la récupération des templates", res.error, "error"); }) - .get( window.location.pathname + "", {}); - } catch (error) { + .get(window.location.pathname + "", {}); + } + catch (error) { swal("Erreur", "Impossible de récupérer les templates.", "error"); } }