diff --git a/text2sql-frontend/src/components/Connection/ConnectionEditor.tsx b/text2sql-frontend/src/components/Connection/ConnectionEditor.tsx index d8d07adc..d85851b7 100644 --- a/text2sql-frontend/src/components/Connection/ConnectionEditor.tsx +++ b/text2sql-frontend/src/components/Connection/ConnectionEditor.tsx @@ -86,20 +86,18 @@ export const ConnectionEditor = () => { fetchConnection(); }, [params.connectionId]); - function handleDelete() { - (async () => { - try { - await api.deleteConnection(params.connectionId!); - fetchConnections(); - fetchConversations(); - navigate(Routes.Root); - } catch (exception) { - enqueueSnackbar({ - variant: "error", - message: "Error deleting connection", - }); - } - })(); + async function handleDelete() { + try { + await api.deleteConnection(params.connectionId!); + fetchConnections(); + fetchConversations(); + navigate(Routes.Root); + } catch (exception) { + enqueueSnackbar({ + variant: "error", + message: "Error deleting connection", + }); + } } function handleSubmit() { if (!unsavedChanges) { @@ -214,6 +212,7 @@ export const ConnectionEditor = () => {