From ed92259842079034b4cd733dd5b36d0ab69f6501 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Mon, 30 Sep 2024 23:51:12 +0530 Subject: [PATCH] feat: return response --- src/components/organisms/ProxyForm.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/organisms/ProxyForm.tsx b/src/components/organisms/ProxyForm.tsx index d45c5968..ae6f7d72 100644 --- a/src/components/organisms/ProxyForm.tsx +++ b/src/components/organisms/ProxyForm.tsx @@ -32,7 +32,11 @@ const ProxyForm: React.FC = () => { e.preventDefault(); try { const response = await axios.post('http://localhost:8080/proxy/config', proxyConfig); - alert(`Success!`); + if (response.status === 200) { + return response.data; + } else { + throw new Error(`Failed to submit proxy configuration. Try again.`); + } } catch (error) { alert('Error submitting proxy configuration'); }