feat: return response
This commit is contained in:
@@ -32,7 +32,11 @@ const ProxyForm: React.FC = () => {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
try {
|
try {
|
||||||
const response = await axios.post('http://localhost:8080/proxy/config', proxyConfig);
|
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) {
|
} catch (error) {
|
||||||
alert('Error submitting proxy configuration');
|
alert('Error submitting proxy configuration');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user